getNew() публичный Метод

Returns a new item of the foreignModel type, pre-initialised to fulfil this relation
public getNew ( ) : DataModel
Результат FOF30\Model\DataModel
Пример #1
0
 /**
  * @group           HasMany
  * @group           HasManyGetNew
  * @covers          FOF30\Model\DataModel\Relation\HasMany::getNew
  */
 public function testGetNew()
 {
     $model = $this->buildModel();
     $model->find(2);
     $relation = new HasMany($model, 'Children');
     $new = $relation->getNew();
     $this->assertInstanceOf('Fakeapp\\Site\\Model\\Children', $new);
     $this->assertEquals(2, $new->getFieldValue('fakeapp_parent_id'), 'HasMany::getNew Failed to prime the new record');
 }