Inheritance: implements Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface
示例#1
0
 /**
  * @param FactoryInterface      $factory
  * @param JsonSchemesInterface  $jsonSchemes
  * @param ModelSchemesInterface $modelSchemes
  */
 public function __construct(FactoryInterface $factory, JsonSchemesInterface $jsonSchemes, ModelSchemesInterface $modelSchemes)
 {
     $this->resourceType = static::TYPE;
     parent::__construct($factory);
     $this->jsonSchemes = $jsonSchemes;
     $this->modelSchemes = $modelSchemes;
 }
示例#2
0
 /**
  * @param SchemaFactoryInterface $factory
  * @param ContainerInterface     $container
  * @param string                 $classType
  * @param Closure                $identityClosure function($resource) : string
  */
 public function __construct(SchemaFactoryInterface $factory, ContainerInterface $container, $classType, Closure $identityClosure)
 {
     $schemaForRealType = $container->getSchemaByType($classType);
     $this->resourceType = $schemaForRealType->getResourceType();
     $this->selfSubUrl = $schemaForRealType->getSelfSubUrl();
     parent::__construct($factory, $container);
     $this->identityClosure = $identityClosure;
 }
示例#3
0
 /**
  * Class constructor
  *
  * @param Neomerx\JsonApi\Contracts\Schema\ContainerInterface $factory ContainerInterface
  * @param Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface $container SchemaFactoryInterface
  * @param Cake\View\View $view Instance of the cake view we are rendering this in
  * @param string $entityName Name of the entity this schema is for
  */
 public function __construct(SchemaFactoryInterface $factory, ContainerInterface $container, View $view, $entityName)
 {
     $this->_view = $view;
     if (!$this->resourceType) {
         $this->resourceType = strtolower(Inflector::pluralize($entityName));
     }
     parent::__construct($factory, $container);
 }
示例#4
0
 /**
  * Overridden so we can set an instance of the resource object
  *
  * @inheritdoc
  */
 public function createResourceObject($resource, $isOriginallyArrayed, $attributeKeysFilter = null)
 {
     $this->setResource($resource);
     return parent::createResourceObject($resource, $isOriginallyArrayed, $attributeKeysFilter);
 }