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