function getRecord()
{
    $parent = new TestParent();
    $parent->TestChildrenA[] = new TestChildA();
    $parent->TestChildrenB[] = new TestChildB();
    $parent->TestChildC = new TestChildC();
    $parent->TestChildD = new TestChildD();
    $parent->save();
    return $parent;
}
Exemplo n.º 2
0
 /**
  * Returns the static model of the specified AR class.
  * Please note that you should have this exact method in all your CActiveRecord descendants!
  * @param string $className active record class name.
  * @return WTestParent the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }