ApiPlatform\Core\Metadata\Resource\ResourceMetadata::getOperationAttribute PHP Method

getOperationAttribute() private method

Gets an operation attribute, optionally fallback to a resource attribute.
private getOperationAttribute ( array $operations = null, string $operationName, string $key, mixed $defaultValue = null, boolean $resourceFallback = false ) : mixed
$operations array
$operationName string
$key string
$defaultValue mixed
$resourceFallback boolean
return mixed
    private function getOperationAttribute(array $operations = null, string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
    {
        if (isset($operations[$operationName][$key])) {
            return $operations[$operationName][$key];
        }
        if ($resourceFallback && isset($this->attributes[$key])) {
            return $this->attributes[$key];
        }
        return $defaultValue;
    }