Wiki

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

A universal model attribute for its synthetic representation

Created about a year ago by Alexandre RodichevskiTips2 comments – viewed 4,368 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 7,741 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 3 years ago by Rohit SutharHow-tos2 comments – viewed 8,977 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 3 years ago by le_topTips0 comments – viewed 9,127 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 11,664 times – ( +1 / -1 ) – version 1.1
The classic Yii way for doing an update action is as follows:

Inline views, write less

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

Debugging CActiveRecord failed save() attempts

Created 4 years ago by BoazTips0 comments – viewed 23,519 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 18,081 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 10,000 times – ( +2 / -1 ) – version 1.1
[EN] [ES]

Using sub query for doubletts

Created 5 years ago by mbTips3 comments – viewed 14,039 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.