Wiki

Articles tagged with "active record"X
Displaying 1-10 of 17 result(s).

A universal model attribute for its synthetic representation

Created 9 months ago by Alexandre RodichevskiTips2 comments – viewed 3,790 times – ( -1 ) – version 2.0
It is convenient to use the same identification attribute, say info, in all of the active records of your application. It should be a virtual read-only attribute defined by a getter method, its label being the model name.

Active Record snapshotting (Model data base history)

Created 2 years ago by BizleyTutorials3 comments – viewed 6,879 times – ( +2 / -1 ) – version 1.1
One of the common tasks the web application might be required to perform, especially the app using some kind of a CMS, is to save the history of data changes. Your client for sure will want the answer to this simple question - If I mess this up or delete by accident can we bring it back? Well, DB backup is one thing and quick recovery is another - let's talk about latter one.

Google style sign out of all other sessions

Created 2 years ago by Rohit SutharHow-tos2 comments – viewed 8,002 times – ( +4 / -1 ) – version 1.1
In this wiki I will show how could logout from all other sessions or all other places.

Expert's model generation with Gii

Created 2 years ago by le_topTips0 comments – viewed 8,391 times – ( +3 / -1 ) – version 1.1
Efficient coding with Yii implies efficient use of the code generator. This article shares the personalised Gii templates that were built starting from the standard templates proposed by AweGen.

How to avoid a database update if the ActiveRecord was not modified

Created 3 years ago by tomvdpHow-tos0 comments – viewed 10,614 times – ( +1 / -1 ) – version 1.1
The classic Yii way for doing an update action is as follows:

Inline views, write less

Created 3 years ago by FirebreakerTips0 comments – viewed 6,349 times – ( +3 / -1 )
Sometimes writing views like

Debugging CActiveRecord failed save() attempts

Created 4 years ago by BoazTips0 comments – viewed 22,065 times – ( +5 / -1 ) – version 1.1
When you're filling up a form of a CActiveRecord (using CActiveForm for example), usually you'll construct your code so that in case of validation error you'll get back the form with the error displayed back to you, typically when CActiveForm.errorSummary() is used. This is how its done by Gii.

Extending an ActiveRecord model

Created 4 years ago by BogseyHow-tos3 comments – viewed 17,259 times – ( +2 / -4 ) – version 1.1
Introduction

Instanciar clase hija basada en campo de modelo padre (CActiveRecord)

Created 4 years ago by robregonmHow-tos0 comments – viewed 9,300 times – ( +2 / -1 ) – version 1.1
[EN] [ES]

Using sub query for doubletts

Created 4 years ago by mbTips3 comments – viewed 13,192 times – ( +2 / -1 ) – version 1.1
find doubletts by db fields. in this example i will check doublets for 3 tabelfields (col1,col2,col3). so i will get a subquery with the condition, select and grouping of the tablefields. the having with COUNT() > 1 means: find all records more then one result.