コード例 #1
0
ファイル: StackFrame.php プロジェクト: REZ1DENT3/json-api
 /**
  * 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();
     }
 }
コード例 #2
0
ファイル: StackFrame.php プロジェクト: michaelbunch/json-api
 /**
  * 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();
     }
 }
コード例 #3
0
ファイル: Parser.php プロジェクト: neomerx/json-api
 /**
  * @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;
 }
コード例 #4
0
ファイル: ReplyInterpreter.php プロジェクト: neomerx/json-api
 /**
  * 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;
 }