attach() public method

Attaches entity
public attach ( integer $id )
$id integer
Example #1
0
 /**
  * @param \LeanMapper\Entity $entity
  * @param $id
  * @return void
  */
 public function makeAlive(\LeanMapper\Entity $entity, $id)
 {
     \Nette\Utils\Validators::assert($id, 'numericint:1..');
     $entity->makeAlive($this->entityFactory, $this->connection, $this->mapper);
     $entity->attach($id);
 }
Example #2
0
 /**
  * @param \LeanMapper\Entity $entity
  * @param $id
  * @throws \LeanMapper\Exception\InvalidStateException
  */
 protected function makeEntityAlive(\LeanMapper\Entity $entity, $id)
 {
     $entity->makeAlive($this->entityFactory, $this->connection, $this->mapper);
     $entity->attach($id);
 }