Esempio n. 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();
     }
 }
Esempio n. 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();
     }
 }
Esempio n. 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;
 }
Esempio n. 4
0
 /**
  * @param string     $rootType
  * @param Frame      $current
  * @param Frame|null $previous
  *
  * @return bool[]
  */
 private function getIfTargets($rootType, Frame $current, Frame $previous = null)
 {
     $currentIsTarget = $this->parameterAnalyzer->isPathIncluded($current->getPath(), $rootType);
     $parentIsTarget = $previous === null || $this->parameterAnalyzer->isPathIncluded($previous->getPath(), $rootType);
     return [$parentIsTarget, $currentIsTarget];
 }
Esempio n. 5
0
 /**
  * @param Frame      $current
  * @param Frame|null $previous
  *
  * @return bool[]
  */
 private function getIfTargets(Frame $current, Frame $previous = null)
 {
     $parentIsTarget = $previous === null || $this->parameters->isPathIncluded($previous->getPath());
     $currentIsTarget = $this->parameters->isPathIncluded($current->getPath());
     return [$parentIsTarget, $currentIsTarget];
 }