Exemple #1
0
 /**
  * @covers ::getNext
  */
 public function testGetNext()
 {
     $model1 = new Model();
     $model2 = new Model();
     $model3 = new Model();
     $models = new Models([$model1, $model2, $model3]);
     $models->getFirst();
     $this->assertSame($model2, $models->getNext());
     $this->assertSame($model3, $models->getNext());
     $this->assertNull($models->getNext());
 }
Exemple #2
0
 /**
  * If model doesn't exist, return a void model
  *
  * @return AbstractModel
  */
 public function getFirst()
 {
     return parent::getFirst() ?: $this->getRepo()->newVoidModel();
 }
Exemple #3
0
 /**
  * If no first, will return void model
  *
  * @return AbstractModel
  */
 public function getFirst()
 {
     return $this->current->getFirst();
 }