PHP Class ApiPlatform\Core\Metadata\Resource\ResourceMetadata

Author: Kévin Dunglas ([email protected])
Datei anzeigen Open project: api-platform/core Class Usage Examples

Public Methods

Method Description
__construct ( string $shortName = null, string $description = null, string $iri = null, array $itemOperations = null, array $collectionOperations = null, array $attributes = null )
getAttribute ( string $key, mixed $defaultValue = null ) : mixed Gets an attribute.
getAttributes ( ) : array | null Gets attributes.
getCollectionOperationAttribute ( string $operationName, string $key, mixed $defaultValue = null, boolean $resourceFallback = false ) : mixed Gets a collection operation attribute, optionally fallback to a resource attribute.
getCollectionOperations ( ) : array | null Gets collection operations.
getDescription ( ) : string | null Gets the description.
getIri ( ) : string | null Gets the associated IRI.
getItemOperationAttribute ( string $operationName, string $key, mixed $defaultValue = null, boolean $resourceFallback = false ) : mixed Gets an item operation attribute, optionally fallback to a resource attribute.
getItemOperations ( ) : array | null Gets item operations.
getShortName ( ) : string | null Gets the short name.
withAttributes ( array $attributes ) : self Returns a new instance with the given attribute.
withCollectionOperations ( array $collectionOperations ) : self Returns a new instance with the given collection operations.
withDescription ( string $description ) : self Returns a new instance with the given description.
withIri ( string $iri ) : self Returns a new instance with the given IRI.
withItemOperations ( array $itemOperations ) : self Returns a new instance with the given item operations.
withShortName ( string $shortName ) : self Returns a new instance with the given short name.

Private Methods

Method Description
getOperationAttribute ( array $operations = null, string $operationName, string $key, mixed $defaultValue = null, boolean $resourceFallback = false ) : mixed Gets an operation attribute, optionally fallback to a resource attribute.

Method Details

__construct() public method

public __construct ( string $shortName = null, string $description = null, string $iri = null, array $itemOperations = null, array $collectionOperations = null, array $attributes = null )
$shortName string
$description string
$iri string
$itemOperations array
$collectionOperations array
$attributes array

getAttribute() public method

Gets an attribute.
public getAttribute ( string $key, mixed $defaultValue = null ) : mixed
$key string
$defaultValue mixed
return mixed

getAttributes() public method

Gets attributes.
public getAttributes ( ) : array | null
return array | null

getCollectionOperationAttribute() public method

Gets a collection operation attribute, optionally fallback to a resource attribute.
public getCollectionOperationAttribute ( string $operationName, string $key, mixed $defaultValue = null, boolean $resourceFallback = false ) : mixed
$operationName string
$key string
$defaultValue mixed
$resourceFallback boolean
return mixed

getCollectionOperations() public method

Gets collection operations.
public getCollectionOperations ( ) : array | null
return array | null

getDescription() public method

Gets the description.
public getDescription ( ) : string | null
return string | null

getIri() public method

Gets the associated IRI.
public getIri ( ) : string | null
return string | null

getItemOperationAttribute() public method

Gets an item operation attribute, optionally fallback to a resource attribute.
public getItemOperationAttribute ( string $operationName, string $key, mixed $defaultValue = null, boolean $resourceFallback = false ) : mixed
$operationName string
$key string
$defaultValue mixed
$resourceFallback boolean
return mixed

getItemOperations() public method

Gets item operations.
public getItemOperations ( ) : array | null
return array | null

getShortName() public method

Gets the short name.
public getShortName ( ) : string | null
return string | null

withAttributes() public method

Returns a new instance with the given attribute.
public withAttributes ( array $attributes ) : self
$attributes array
return self

withCollectionOperations() public method

Returns a new instance with the given collection operations.
public withCollectionOperations ( array $collectionOperations ) : self
$collectionOperations array
return self

withDescription() public method

Returns a new instance with the given description.
public withDescription ( string $description ) : self
$description string
return self

withIri() public method

Returns a new instance with the given IRI.
public withIri ( string $iri ) : self
$iri string
return self

withItemOperations() public method

Returns a new instance with the given item operations.
public withItemOperations ( array $itemOperations ) : self
$itemOperations array
return self

withShortName() public method

Returns a new instance with the given short name.
public withShortName ( string $shortName ) : self
$shortName string
return self