| @@ 586-595 (lines=10) @@ | ||
| 583 | * @throws ORMInvalidArgumentException |
|
| 584 | * @throws ORMException |
|
| 585 | */ |
|
| 586 | public function persist($entity) |
|
| 587 | { |
|
| 588 | if ( ! is_object($entity)) { |
|
| 589 | throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity); |
|
| 590 | } |
|
| 591 | ||
| 592 | $this->errorIfClosed(); |
|
| 593 | ||
| 594 | $this->unitOfWork->persist($entity); |
|
| 595 | } |
|
| 596 | ||
| 597 | /** |
|
| 598 | * Removes an entity instance. |
|
| @@ 610-619 (lines=10) @@ | ||
| 607 | * @throws ORMInvalidArgumentException |
|
| 608 | * @throws ORMException |
|
| 609 | */ |
|
| 610 | public function remove($entity) |
|
| 611 | { |
|
| 612 | if ( ! is_object($entity)) { |
|
| 613 | throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity); |
|
| 614 | } |
|
| 615 | ||
| 616 | $this->errorIfClosed(); |
|
| 617 | ||
| 618 | $this->unitOfWork->remove($entity); |
|
| 619 | } |
|
| 620 | ||
| 621 | /** |
|
| 622 | * Refreshes the persistent state of an entity from the database, |
|
| @@ 632-641 (lines=10) @@ | ||
| 629 | * @throws ORMInvalidArgumentException |
|
| 630 | * @throws ORMException |
|
| 631 | */ |
|
| 632 | public function refresh($entity) |
|
| 633 | { |
|
| 634 | if ( ! is_object($entity)) { |
|
| 635 | throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity); |
|
| 636 | } |
|
| 637 | ||
| 638 | $this->errorIfClosed(); |
|
| 639 | ||
| 640 | $this->unitOfWork->refresh($entity); |
|
| 641 | } |
|
| 642 | ||
| 643 | /** |
|
| 644 | * Detaches an entity from the EntityManager, causing a managed entity to |
|
| @@ 677-686 (lines=10) @@ | ||
| 674 | * @throws ORMInvalidArgumentException |
|
| 675 | * @throws ORMException |
|
| 676 | */ |
|
| 677 | public function merge($entity) |
|
| 678 | { |
|
| 679 | if ( ! is_object($entity)) { |
|
| 680 | throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity); |
|
| 681 | } |
|
| 682 | ||
| 683 | $this->errorIfClosed(); |
|
| 684 | ||
| 685 | return $this->unitOfWork->merge($entity); |
|
| 686 | } |
|
| 687 | ||
| 688 | /** |
|
| 689 | * {@inheritDoc} |
|