コード例 #1
0
ファイル: LinkMany.php プロジェクト: harp-orm/harp
 /**
  * Implement Iterator
  */
 public function key()
 {
     return $this->current->key();
 }
コード例 #2
0
ファイル: ModelsTest.php プロジェクト: harp-orm/harp
 /**
  * @covers ::current
  * @covers ::key
  * @covers ::next
  * @covers ::rewind
  * @covers ::valid
  */
 public function testIterator()
 {
     $source = [new City(), new City()];
     $models = new Models($source);
     $key = $models->key();
     foreach ($models as $i => $model) {
         $this->assertSame(current($source), $model);
         next($source);
     }
 }