/** * @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; }
/** * @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; }
/** * 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); }
/** * 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); }