Define the resource that can be sent with the request.
Note that this method will not generate actual parameters, but instead
will let the InputParsers know this resource can be expected.
@param $resourceDefinition
@return ResourceParameter
766677
public function resource($resourceDefinition)
    {
        $parameter = new ResourceParameter($resourceDefinition);
        $parameter->setRoute($this->route);

        $this->parameters[$resourceDefinition] = $parameter;

        return $parameter;
    }
158282
public function toRouteDefinition()
    {
        $routes = [];

        foreach ($this->paths as $path) {
            $routes[] = sprintf(
                $this->getTemplate(), 'Resource: '.$this->name.'@'.$path->method,
                $this->implodeArray($this->getMiddleware($path)),
                var_export($path->path, true), $this->implodeArray($path->where),
                var_export($path->domain, true), var_export($this->name, true),
                var_export($this->reflection->name, true), $this->implodeArray([$path->method]),
                $this->implodeArray($this->getNames($path))
            );
        }

        return implode(PHP_EOL.PHP_EOL, $routes);
    }
192646
private function getDictionaryBuilder(DictionaryDefinition $definition): DictionaryBuilderInterface
    {
        if (!$this->dictionaryBuilders->has($typeName = $definition->getType())) {
            $typeName = 'default';
        }

        return $this->dictionaryBuilders->get($typeName);
    }
380265
public function parseMigrationDefinition(MigrationDefinition $definition)
    {
        try {
            $data = Yaml::parse($definition->rawDefinition);
        } catch (\Exception $e) {
            return new WorkflowDefinition(
                $definition->name,
                $definition->path,
                $definition->rawDefinition,
                MigrationDefinition::STATUS_INVALID,
                array(),
                $e->getMessage()
            );
        }

        return $this->parseMigrationDefinitionData($data, $definition);
    }
235957
public static function fromResource(Resource $resource)
    {
        if (isset($resource->query['with_billets'])) {
            return static::withBillets($resource);
        }
        return parent::fromResource($resource);
    }
765911
private function createChoiceFormDefinition(ResourceInterface $resource)
    {
        $definition = new Definition($resource->getChoiceForm(), [
            new Reference('lug.resource.'.$resource->getName()),
        ]);

        $definition->addTag('form.type');

        return $definition;
    }
134263
public function normalize($data, Resource $resource)
    {
        $class = '';
        $definitions = [];
        foreach ($data['value'] as $validator) {
            $class = $validator['metadata']['class'];
            if (isset($validator['property'])) {
                $definitions['properties'][$validator['property']][] = $this->delegator->normalize($validator, $resource);
            }
        }

        return $this->createDefinition($class, $definitions);
    }
1093803
public function createDictionary(DictionaryDefinition $definition): DictionaryInterface
    {
        $builder = $this->getDictionaryBuilder($definition);

        /** @var DictionaryBuilderInterface $builder */
        return $builder->build($this, $definition);
    }
1235900
protected function getResourceParameter()
    {
        $resource = parent::getResourceParameter();
        if ($resource->isInstanceOf($this->getClass(GenerisRdf::CLASS_GENERIS_USER))) {
            return $resource;
        }

        throw new InvalidArgumentException('Only user resource are allowed.');
    }
314671
private function getResourceParam($uri)
    {
        $resource = $this->injector->getInstance(ResourceInterface::class);
        $resourceResult = $resource->get->uri($uri)->eager->request();
        $fragment = parse_url($uri, PHP_URL_FRAGMENT);

        return $resourceResult[$fragment];
    }
1115167
public function getIdentifiers(
        ResourceTransformer $resourceTransformer,
        ResourceDefinition $resourceDefinition,
        Context $context,
        $resource = null
    ) {
        if (!$this->hasApplicableContentType()) {
            return null;
        }

        $content = $this->getRawContent();
        $content = json_decode($content, true);

        if (!$content) {
            throw new \InvalidArgumentException("Could not decode body.");
        }

        $identifierCollection = new IdentifierCollection();

        if (isset($content[ResourceTransformer::RELATIONSHIP_ITEMS])) {
            // This is a list of items
            foreach ($content[ResourceTransformer::RELATIONSHIP_ITEMS] as $item) {
                $identifier = $this->arrayToIdentifier($resourceDefinition, $item);
                if ($identifier) {
                    $identifierCollection->add($identifier);
                }
            }
        } else {
            $identifier = $this->arrayToIdentifier($resourceDefinition, $content);
            if ($identifier) {
                $identifierCollection->add($identifier);
            }
        }

        return $identifierCollection;
    }
334081
protected function dynamicResourceMapper($resourceId)
    {
        // Page Resource Mapper
        $resource = $this->pageResourceMapper($resourceId);

        if (!empty($resource)) {
            return $resource;
        }

        $resource = $this->siteResourceMapper($resourceId);

        if (!empty($resource)) {
            return $resource;
        }

        return null;
    }
1153825
public function getFieldDefinition($fieldDefinitionIdentifier)
    {
        if (isset($this->fieldDefinitionsByIdentifier[$fieldDefinitionIdentifier])) {
            return $this->fieldDefinitionsByIdentifier[$fieldDefinitionIdentifier];
        }

        return null;
    }
1369025
public function toFieldDefinition(StorageFieldDefinition $storageDefinition, FieldDefinition $fieldDefinition)
    {
        $fieldDefinition->defaultValue->data = Value::EMPTY_VALUE;
    }
478148
public static function fromResources(ResourceInterface ...$resources) {
		$collectionDocument = new self();
		
		foreach ($resources as $resource) {
			$collectionDocument->addResource($resource);
		}
		
		return $collectionDocument;
	}
1086311
private function getResourceFromNode(ResourceNode $resourceNode)
    {
        /** @var AbstractResource $resource */
        $resource = $this->om
            ->getRepository($resourceNode->getClass())
            ->findOneBy(['resourceNode' => $resourceNode]);

        return $resource;
    }
690792
private function convertToFieldDefintionObject($identifier, $fieldDefinition)
    {
        if ($fieldDefinition instanceof FieldDefinitionObject) {
            return $fieldDefinition;
        } else {
            return new FieldDefinitionObject($identifier, $this, $fieldDefinition);
        }
    }