Wiki articles tagged with "model"

Showing 21-28 of 28 items.

model rules depended by user roles-permissions

Created 10 years ago by Kostas Apazidis (KonApaz), updated 10 years ago by Kostas Apazidis (KonApaz).

This is a reference about model validators and user roles. In many cases we want model validators to applied only for some privileged users or not

3 0
3 followers
Viewed: 19 254 times
Version: Unknown (update)
Category: How-tos

Inline views, write less

Created 10 years ago by Firebreaker, updated 10 years ago by Firebreaker.

Sometimes writing views like

3 0
3 followers
Viewed: 11 551 times
Version: Unknown (update)
Category: Tips

Update two models with one view

Created 12 years ago by sensorario, updated 11 years ago by SebK.

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).

9 3
13 followers
Viewed: 55 439 times
Version: 1.1
Category: Tips

Managing constants easily

Created 12 years ago by briiC.lv, updated 12 years ago by briiC.lv.

/*

    Get class constants by token.
    If you set constants with same prefix, like:
	MY_STATUS_1
	MY_STATUS_2
	MY_STATUS_3
4 0
7 followers
Viewed: 30 662 times
Version: 1.1
Category: Tips

Application-driven database with CDbMigration and an extended CActiveRecord

Created 12 years ago by Tudor Ilisoi, updated 12 years ago by Tudor Ilisoi.

This is an incipient implementation of application-driven database with Yii.

8 0
10 followers
Viewed: 16 400 times
Version: 1.1
Category: Others

Single table inheritance

Created 12 years ago by samdark, updated 12 years ago by samdark.

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...

34 0
35 followers
Viewed: 52 908 times
Version: 1.1
Category: How-tos

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

Created 13 years ago by Mukke, updated 12 years ago by jwerner.

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.

10 0
11 followers
Viewed: 37 241 times
Version: 1.1
Category: Tips

Reference: Model rules validation

Created 14 years ago by krillzip, updated 10 years ago by Rodrigo.

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.

99 0
114 followers
Viewed: 884 878 times
Version: 1.1
Category: How-tos