Object::extraRelationships PHP Method

extraRelationships() public static method

Define Relationships so that its child class can call it
public static extraRelationships ( ) : type
return type
    public static function extraRelationships()
    {
        // NOTE: you may need to adjust the relation name and the related
        // class name for the relations automatically generated below.
        return array('author' => array(self::BELONGS_TO, 'User', 'object_author'), 'language' => array(self::BELONGS_TO, 'Language', 'lang'));
    }

Usage Example

Example #1
0
 /**
  * @return array relational rules.
  */
 public function relations()
 {
     return CMap::mergeArray(array(), Object::extraRelationships());
 }