Exemple #1
0
 /**
  * Set path to current frame.
  */
 private function setCurrentPath()
 {
     if ($this->previous === null || $this->previous->getPath() === null) {
         $this->path = $this->relationship->getName();
     } else {
         $this->path = $this->previous->getPath() . '.' . $this->relationship->getName();
     }
 }
Exemple #2
0
 /**
  * Set path to current frame.
  */
 private function setCurrentPath()
 {
     if ($this->previous === null || $this->previous->getPath() === null) {
         $this->path = $this->relationship->getName();
     } else {
         $this->path = $this->previous->getPath() . DocumentInterface::PATH_SEPARATOR . $this->relationship->getName();
     }
 }
Exemple #3
0
 /**
  * @param mixed                       $resource
  * @param StackFrameReadOnlyInterface $frame
  *
  * @return SchemaProviderInterface
  */
 private function getSchema($resource, StackFrameReadOnlyInterface $frame)
 {
     try {
         $schema = $this->container->getSchema($resource);
     } catch (InvalidArgumentException $exception) {
         $message = T::t('Schema is not registered for a resource at path \'%s\'.', [$frame->getPath()]);
         throw new InvalidArgumentException($message, 0, $exception);
     }
     return $schema;
 }
 /**
  * If relationship from 'parent' to 'current' resource passes field set filter.
  *
  * @param Frame $current
  * @param Frame $previous
  *
  * @return bool
  */
 private function isRelationshipInFieldSet(Frame $current, Frame $previous)
 {
     $parentType = $previous->getResource()->getType();
     $parameters = $this->parameterAnalyzer->getParameters();
     if (($fieldSet = $parameters->getFieldSet($parentType)) === null) {
         return true;
     }
     return in_array($current->getRelationship()->getName(), $fieldSet, true) === true;
 }