コード例 #1
0
ファイル: LinkMany.php プロジェクト: harp-orm/harp
 /**
  * Call a method on each of the models, return the results as an array
  *
  * @param  string $methodName
  * @return array
  */
 public function invoke($methodName)
 {
     return $this->current->invoke($methodName);
 }
コード例 #2
0
ファイル: ModelsTest.php プロジェクト: harp-orm/harp
 /**
  * @covers ::invoke
  */
 public function testInvoke()
 {
     $source = [new City(['id' => 1]), new City(['id' => 1]), new City(['id' => 2])];
     $models = new Models($source);
     $result = $models->invoke('getId');
     $this->assertEquals([1, 1, 2], $result);
 }