AbstractResourceRepresentation

Abstract API resource representation. Provides functionality for representations of registered API resources.
extends Omeka\Api\Representation\AbstractRepresentation

Known subclasses

Omeka\Api\Representation\AbstractEntityRepresentation, Omeka\Api\Representation\AbstractResourceEntityRepresentation, Omeka\Api\Representation\AbstractVocabularyMemberRepresentation, Omeka\Api\Representation\ApiResourceRepresentation, Omeka\Api\Representation\AssetRepresentation, Omeka\Api\Representation\ItemRepresentation, Omeka\Api\Representation\ItemSetRepresentation, Omeka\Api\Representation\JobRepresentation, Omeka\Api\Representation\MediaRepresentation, Omeka\Api\Representation\ModuleRepresentation, Omeka\Api\Representation\PropertyRepresentation, Omeka\Api\Representation\ResourceClassRepresentation, Omeka\Api\Representation\ResourceTemplateRepresentation, Omeka\Api\Representation\SitePageRepresentation, Omeka\Api\Representation\SiteRepresentation, Omeka\Api\Representation\UserRepresentation, Omeka\Api\Representation\VocabularyRepresentation
Abstract
Open source code
Methods Summary
abstract public
# getJsonLd( )
Get an array representation of this resource using JSON-LD notation.
abstract public
# getJsonLdType( )
Get the linked data type or types for this resource
public
# __construct( Omeka\Api\ResourceInterface $resource , Omeka\Api\Adapter\AdapterInterface $adapter )
Construct the resource representation object.
public
# id( )
Get the unique resource identifier.
public
# jsonSerialize( )
Compose the complete JSON-LD object.
protected
# setId( $id )
Set the unique resource identifier.
protected
# setAdapter( Omeka\Api\Adapter\AdapterInterface $adapter )
Set the corresponding adapter.
protected
# getAdapter( null|string $resourceName = NULL )
Get the corresponding adapter or another adapter by resource name.

Overrides

public
# getReference( )
Get a reference for this resource representation.
public
# apiUrl( )
Get the URL to the represented resource in the API
public
# url( string $action = NULL, bool $canonical = false )
Return the URL to this resource. Automatically detects whether to compose an admin URL or site URL depending on the current route context. To compose URLs across contexts, use {@link self::adminUrl()} or {@link self::siteUrl()} directly.
public
# adminUrl( string $action = NULL, bool $canonical = false )
Return the admin URL to this resource.
public
# siteUrl( string $siteSlug = NULL, bool $canonical = false )
Return the site URL to this resource. Implement this method only for resources that have site URLs.
public
# linkRaw( string $html , string $action = NULL, array $attributes = array ( ) )
Get an HTML link to a resource, with the link contents unescaped. This method allows for more complex HTML within a link, but Users of this method must ensure any untrusted components of their contents are already escaped or filtered as necessary. Link attributes are still auto-escaped by this method.
public
# getFileUrl( string $prefix , string $name , null|string $extension = NULL )
Get a URL to a stored file.
protected
# getControllerName( )
Get the name for the controller that handles this kind of resource.
public
# embeddedJsonLd( )
Get markup for embedding the JSON-LD representation of this resource in HTML.
Methods inherited from Omeka\Api\Representation\AbstractRepresentation
getAdapter(), getDateTime(), getTranslator(), getViewHelper(), primaryMedia(), getServiceLocator(), setServiceLocator()
Properties Summary
protected string|int $id
# NULL
protected Omeka\Api\ResourceInterface $resource
# NULL
protected Omeka\Api\Adapter\AdapterInterface $adapter
# NULL
Properties inherited from Omeka\Api\Representation\AbstractRepresentation
$translator, $viewHelperManager, $services