setTableName('adult'); $this->hasColumn('id', 'integer', 11, array('primary' => true, 'autoincrement' => true)); $this->hasColumn('name', 'string', 255); $this->hasColumn('contact_id', 'integer', 11); } public function setUp() { $this->hasOne('Contact', array('local' => 'contact_id', 'foreign' => 'id')); $this->hasMany('Child as Children', array('local' => 'id', 'foreign' => 'adult_id')); } }