public function __construct(RestedServiceInterface $restedService, UrlGeneratorInterface $urlGenerator, CompiledResourceDefinitionInterface $resourceDefinition, ResourceInterface $resource, ContextInterface $context, $href, array $items, $total) { $count = sizeof($items); parent::__construct($restedService, $urlGenerator, $resource, $context, $href, ['count' => $count, 'total' => $total !== null ? $total : $count]); $this->setResource('items', $items); $this->addActions($resourceDefinition, [ActionDefinition::TYPE_CREATE]); }
public function __construct(RestedServiceInterface $restedService, UrlGeneratorInterface $urlGenerator, CompiledResourceDefinitionInterface $resourceDefinition, ResourceInterface $resource, ContextInterface $context, $href, array $data, $instance = null) { parent::__construct($restedService, $urlGenerator, $resource, $context, $href, $data); $this->addActions($resourceDefinition, [ActionDefinition::TYPE_DELETE, ActionDefinition::TYPE_INSTANCE_AFFORDANCE, ActionDefinition::TYPE_UPDATE], $instance); }