Wiki

Articles tagged with "model"X
Displaying 1-6 of 6 result(s).

Update two models with one view

Created about a year ago by sensorarioTips10 comments – viewed 18,673 times – ( +10 / -2 )
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
tags: database, model, view, form

Managing constants easily

Created about a year ago by briiC.lvTips4 comments – viewed 6,177 times – ( +4 )
For time to time i have models with constants (basicly status constants) which i use in diferent places and if these constant changes, i have to change mentions of constant in code elsewhere.

Application-driven database with CDbMigration and an extended CActiveRecord

Created about a year ago by Tudor IlisoiOthers0 comments – viewed 5,851 times – ( +7 )
This is an incipient implementation of application-driven database with Yii.
tags: database, model

Single table inheritance

Created about a year ago by samdarkHow-tos6 comments – viewed 13,727 times – ( +31 )
Relational databases do not support inheritance so if we need to represent it, we have to somehow store meta info while keeping performance by minimizing JOINs. One way to solve this problem is using single table inheritance. All fields for the whole class tree are stored in a single table. Class name is stored in the type field of the same table.

Search method of a model for filters when using dates - unixtimestamp in database

Created 2 years ago by MukkeTips1 comment – viewed 15,059 times – ( +10 )
I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.

Reference: Model rules validation

Created 3 years ago by krillzipHow-tos4 comments – viewed 253,770 times – ( +86 )
This is a reference to be used for Model rule validation and is compiled from the Yii documentation and code. The purpose is to have all the information gathered in one place instead of scattered. This reference is not an intro. See The Definitive Guide to Yii, Declaring Validation Rules for a tutorial.