| @@ 593-602 (lines=10) @@ | ||
| 590 | * @throws ORMInvalidArgumentException |
|
| 591 | * @throws ORMException |
|
| 592 | */ |
|
| 593 | public function persist($entity) |
|
| 594 | { |
|
| 595 | if ( ! is_object($entity)) { |
|
| 596 | throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity); |
|
| 597 | } |
|
| 598 | ||
| 599 | $this->errorIfClosed(); |
|
| 600 | ||
| 601 | $this->unitOfWork->persist($entity); |
|
| 602 | } |
|
| 603 | ||
| 604 | /** |
|
| 605 | * Removes an entity instance. |
|
| @@ 617-626 (lines=10) @@ | ||
| 614 | * @throws ORMInvalidArgumentException |
|
| 615 | * @throws ORMException |
|
| 616 | */ |
|
| 617 | public function remove($entity) |
|
| 618 | { |
|
| 619 | if ( ! is_object($entity)) { |
|
| 620 | throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity); |
|
| 621 | } |
|
| 622 | ||
| 623 | $this->errorIfClosed(); |
|
| 624 | ||
| 625 | $this->unitOfWork->remove($entity); |
|
| 626 | } |
|
| 627 | ||
| 628 | /** |
|
| 629 | * Refreshes the persistent state of an entity from the database, |
|
| @@ 639-648 (lines=10) @@ | ||
| 636 | * @throws ORMInvalidArgumentException |
|
| 637 | * @throws ORMException |
|
| 638 | */ |
|
| 639 | public function refresh($entity) |
|
| 640 | { |
|
| 641 | if ( ! is_object($entity)) { |
|
| 642 | throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity); |
|
| 643 | } |
|
| 644 | ||
| 645 | $this->errorIfClosed(); |
|
| 646 | ||
| 647 | $this->unitOfWork->refresh($entity); |
|
| 648 | } |
|
| 649 | ||
| 650 | /** |
|
| 651 | * Detaches an entity from the EntityManager, causing a managed entity to |
|