상속: extends Pheasant\DomainObject
예제 #1
0
 public function setUp()
 {
     parent::setUp();
     $migrator = new \Pheasant\Migrate\Migrator();
     $migrator->create('user', User::schema())->create('userpref', UserPref::schema());
     // create some users
     $this->users = User::import(array(array('firstname' => 'Frank', 'lastname' => 'Castle'), array('firstname' => 'Cletus', 'lastname' => 'Kasady')));
     // create some user prefs
     $this->userprefs = UserPref::import(array(array('User' => $this->users[0], 'pref' => 'autologin', 'value' => 'yes'), array('User' => $this->users[1], 'pref' => 'autologin', 'value' => 'no')));
     $this->assertTrue($this->userprefs[0]->User->equals($this->users[0]));
     $this->assertTrue($this->userprefs[1]->User->equals($this->users[1]));
 }
예제 #2
0
파일: User.php 프로젝트: lox/pheasant
 public function relationships()
 {
     return array('UserPrefs' => UserPref::hasMany('userid'));
 }