コード例 #1
0
ファイル: ModelsTest.php プロジェクト: harp-orm/core
 /**
  * @covers ::isEmptyProperty
  */
 public function testIsEmptyProperty()
 {
     $models = new Models([new Model(['id' => 10, 'name' => null]), new Model(['id' => 20, 'name' => null]), new Model(['id' => null, 'name' => null])]);
     $this->assertFalse($models->isEmptyProperty('id'));
     $this->assertTrue($models->isEmptyProperty('name'));
 }
コード例 #2
0
ファイル: One.php プロジェクト: harp-orm/core
 public function hasForeign(Models $models)
 {
     return !$models->isEmptyProperty($this->key);
 }
コード例 #3
0
ファイル: Many.php プロジェクト: harp-orm/core
 public function hasForeign(Models $models)
 {
     return !$models->isEmptyProperty($this->getRepo()->getPrimaryKey());
 }