PHP 인터페이스 WoohooLabs\Yin\JsonApi\Transformer\ResourceTransformerInterface

파일 보기 프로젝트 열기: woohoolabs/yin 0 사용 예제들

공개 메소드들

메소드 설명
getAttributes ( mixed $domainObject ) : callable[] Provides information about the "attributes" section of the current resource.
getDefaultIncludedRelationships ( mixed $domainObject ) : array Returns an array of relationship names which are included in the response by default.
getId ( mixed $domainObject ) : string Provides information about the "id" section of the current resource.
getLinks ( mixed $domainObject ) : WoohooLabs\Yin\JsonApi\Schema\Links | null Provides information about the "links" section of the current resource.
getMeta ( mixed $domainObject ) : array Provides information about the "meta" section of the current resource.
getRelationships ( mixed $domainObject ) : callable[] Provides information about the "relationships" section of the current resource.
getType ( mixed $domainObject ) : string Provides information about the "type" section of the current resource.
transformRelationship ( string $relationshipName, Transformation $transformation, mixed $domainObject, array $additionalMeta = [] ) : array
transformToResource ( Transformation $transformation, mixed $domainObject ) : array
transformToResourceIdentifier ( mixed $domainObject ) : array | null

메소드 상세

getAttributes() 공개 메소드

The method returns an array where the keys signify the attribute names, while the values are callables receiving the domain object as an argument, and they should return the value of the corresponding attribute.
public getAttributes ( mixed $domainObject ) : callable[]
$domainObject mixed
리턴 callable[]

getDefaultIncludedRelationships() 공개 메소드

Returns an array of relationship names which are included in the response by default.
public getDefaultIncludedRelationships ( mixed $domainObject ) : array
$domainObject mixed
리턴 array

getId() 공개 메소드

The method returns the ID of the current resource which should be a UUID.
public getId ( mixed $domainObject ) : string
$domainObject mixed
리턴 string

getMeta() 공개 메소드

The method returns an array of non-standard meta information about the resource. If this array is empty, the section won't appear in the response.
public getMeta ( mixed $domainObject ) : array
$domainObject mixed
리턴 array

getRelationships() 공개 메소드

The method returns an array where the keys signify the relationship names, while the values are callables receiving the domain object as an argument, and they should return a new relationship instance (to-one or to-many).
public getRelationships ( mixed $domainObject ) : callable[]
$domainObject mixed
리턴 callable[]

getType() 공개 메소드

The method returns the type of the current resource.
public getType ( mixed $domainObject ) : string
$domainObject mixed
리턴 string

transformRelationship() 공개 메소드

public transformRelationship ( string $relationshipName, Transformation $transformation, mixed $domainObject, array $additionalMeta = [] ) : array
$relationshipName string
$transformation Transformation
$domainObject mixed
$additionalMeta array
리턴 array

transformToResource() 공개 메소드

public transformToResource ( Transformation $transformation, mixed $domainObject ) : array
$transformation Transformation
$domainObject mixed
리턴 array

transformToResourceIdentifier() 공개 메소드

public transformToResourceIdentifier ( mixed $domainObject ) : array | null
$domainObject mixed
리턴 array | null