@@ 639-693 (lines=55) @@ | ||
636 | * @return ObjectDataInterface|null Returns object of type ObjectDataInterface or <code>null</code> |
|
637 | * if the repository response was empty |
|
638 | */ |
|
639 | public function getObject( |
|
640 | $repositoryId, |
|
641 | $objectId, |
|
642 | $filter = null, |
|
643 | $includeAllowableActions = false, |
|
644 | IncludeRelationships $includeRelationships = null, |
|
645 | $renditionFilter = Constants::RENDITION_NONE, |
|
646 | $includePolicyIds = false, |
|
647 | $includeAcl = false, |
|
648 | ExtensionDataInterface $extension = null |
|
649 | ) { |
|
650 | $cacheKey = $this->createCacheKey( |
|
651 | $objectId, |
|
652 | array( |
|
653 | $repositoryId, |
|
654 | $filter, |
|
655 | $includeAllowableActions, |
|
656 | $includeRelationships, |
|
657 | $renditionFilter, |
|
658 | $includePolicyIds, |
|
659 | $includeAcl, |
|
660 | $extension, |
|
661 | $this->getSuccinct() |
|
662 | ) |
|
663 | ); |
|
664 | if ($this->isCached($cacheKey)) { |
|
665 | return $this->getCached($cacheKey); |
|
666 | } |
|
667 | $url = $this->getObjectUrl($repositoryId, $objectId, Constants::SELECTOR_OBJECT); |
|
668 | $url->getQuery()->modify( |
|
669 | array( |
|
670 | Constants::PARAM_ALLOWABLE_ACTIONS => $includeAllowableActions ? 'true' : 'false', |
|
671 | Constants::PARAM_RENDITION_FILTER => $renditionFilter, |
|
672 | Constants::PARAM_POLICY_IDS => $includePolicyIds ? 'true' : 'false', |
|
673 | Constants::PARAM_ACL => $includeAcl ? 'true' : 'false', |
|
674 | Constants::PARAM_SUCCINCT => $this->getSuccinct() ? 'true' : 'false', |
|
675 | Constants::PARAM_DATETIME_FORMAT => (string) $this->getDateTimeFormat() |
|
676 | ) |
|
677 | ); |
|
678 | ||
679 | if (!empty($filter)) { |
|
680 | $url->getQuery()->modify(array(Constants::PARAM_FILTER => (string) $filter)); |
|
681 | } |
|
682 | ||
683 | if ($includeRelationships !== null) { |
|
684 | $url->getQuery()->modify(array(Constants::PARAM_RELATIONSHIPS => (string) $includeRelationships)); |
|
685 | } |
|
686 | ||
687 | $responseData = $this->read($url)->json(); |
|
688 | ||
689 | return $this->cache( |
|
690 | $cacheKey, |
|
691 | $this->getJsonConverter()->convertObject($responseData) |
|
692 | ); |
|
693 | } |
|
694 | ||
695 | /** |
|
696 | * Gets the specified information for the object specified by path. |
|
@@ 716-771 (lines=56) @@ | ||
713 | * @return ObjectDataInterface|null Returns object of type <code>ObjectDataInterface</code> or <code>null</code> |
|
714 | * if the repository response was empty |
|
715 | */ |
|
716 | public function getObjectByPath( |
|
717 | $repositoryId, |
|
718 | $path, |
|
719 | $filter = null, |
|
720 | $includeAllowableActions = false, |
|
721 | IncludeRelationships $includeRelationships = null, |
|
722 | $renditionFilter = Constants::RENDITION_NONE, |
|
723 | $includePolicyIds = false, |
|
724 | $includeAcl = false, |
|
725 | ExtensionDataInterface $extension = null |
|
726 | ) { |
|
727 | $cacheKey = $this->createCacheKey( |
|
728 | $path, |
|
729 | array( |
|
730 | $repositoryId, |
|
731 | $filter, |
|
732 | $includeAllowableActions, |
|
733 | $includeRelationships, |
|
734 | $renditionFilter, |
|
735 | $includePolicyIds, |
|
736 | $includeAcl, |
|
737 | $extension, |
|
738 | $this->getSuccinct() |
|
739 | ) |
|
740 | ); |
|
741 | if ($this->isCached($cacheKey)) { |
|
742 | return $this->getCached($cacheKey); |
|
743 | } |
|
744 | ||
745 | $url = $this->getPathUrl($repositoryId, $path, Constants::SELECTOR_OBJECT); |
|
746 | $url->getQuery()->modify( |
|
747 | array( |
|
748 | Constants::PARAM_ALLOWABLE_ACTIONS => $includeAllowableActions ? 'true' : 'false', |
|
749 | Constants::PARAM_RENDITION_FILTER => $renditionFilter, |
|
750 | Constants::PARAM_POLICY_IDS => $includePolicyIds ? 'true' : 'false', |
|
751 | Constants::PARAM_ACL => $includeAcl ? 'true' : 'false', |
|
752 | Constants::PARAM_SUCCINCT => $this->getSuccinct() ? 'true' : 'false', |
|
753 | Constants::PARAM_DATETIME_FORMAT => (string) $this->getDateTimeFormat() |
|
754 | ) |
|
755 | ); |
|
756 | ||
757 | if (!empty($filter)) { |
|
758 | $url->getQuery()->modify(array(Constants::PARAM_FILTER => (string) $filter)); |
|
759 | } |
|
760 | ||
761 | if ($includeRelationships !== null) { |
|
762 | $url->getQuery()->modify(array(Constants::PARAM_RELATIONSHIPS => (string) $includeRelationships)); |
|
763 | } |
|
764 | ||
765 | $responseData = $this->read($url)->json(); |
|
766 | ||
767 | return $this->cache( |
|
768 | $cacheKey, |
|
769 | $this->getJsonConverter()->convertObject($responseData) |
|
770 | ); |
|
771 | } |
|
772 | ||
773 | /** |
|
774 | * Gets the list of properties for an object. |