Difference between #5 and #6 of
The Comedy of Errors

Revision #6 has been created by softark on Apr 16, 2012, 6:54:03 AM with the memo:

Rules for foreign keys
« previous (#5) next (#7) »

Changes

Title unchanged

The Comedy of Errors

Category unchanged

Others

Yii version unchanged

Tags unchanged

errors

Content changed

[...]
In the model rules() method put:

```php
array('format', 'range', 'in' => array('html', 'rss2', 'atom', 'json', 'xml')),
```
then later remind yourself that Yii is not SQL.

 
 
 
Rules for foreign keys
 
----------------------
 
 
In the model rules() method put:
 
 
```php 
array('foreingKey', 'exists', 'className' => 'SomeModel', 'attributeName' => 'id'),
 
```
 
Sure we have 'exists' method for CActiveRecord model, but ...
19 0
15 followers
Viewed: 18 998 times
Version: 1.1
Category: Others
Written by: fsb
Last updated by: Mike
Created on: Dec 7, 2011
Last updated: 10 years ago
Update Article

Revisions

View all history