コード例 #1
0
 /**
  * @param Exclusion|null $exclusion
  * @return Exclusion
  */
 private function transformExclusion(Exclusion $exclusion = null)
 {
     if (!$exclusion) {
         return new Exclusion([$this->exclusionGroup]);
     }
     $groups = is_array($exclusion->getGroups()) ? $exclusion->getGroups() : [];
     return new Exclusion(array_merge($groups, [$this->exclusionGroup]), $exclusion->getSinceVersion(), $exclusion->getUntilVersion(), $exclusion->getMaxDepth(), $exclusion->getExcludeIf());
 }
コード例 #2
0
 public function __construct(Exclusion $exclusion = null)
 {
     if (null === $exclusion) {
         return;
     }
     $this->groups = $exclusion->getGroups();
     $this->sinceVersion = $exclusion->getSinceVersion();
     $this->untilVersion = $exclusion->getUntilVersion();
     $this->maxDepth = $exclusion->getMaxDepth();
 }
コード例 #3
0
 public function __construct(Exclusion $exclusion = null, Relation $relation = null)
 {
     if (null !== $relation) {
         $this->name = $relation->getName();
         $this->class = get_class($relation);
         $typeParser = new TypeParser();
         if (null !== $relation->getEmbedded()) {
             $this->type = $typeParser->parse('Hateoas\\Model\\Embedded');
         } elseif (null !== $relation->getHref()) {
             $this->type = $typeParser->parse('Hateoas\\Model\\Link');
         }
     }
     if (null === $exclusion) {
         return;
     }
     $this->groups = $exclusion->getGroups();
     $this->sinceVersion = $exclusion->getSinceVersion();
     $this->untilVersion = $exclusion->getUntilVersion();
     $this->maxDepth = $exclusion->getMaxDepth();
 }