PHP Трейт eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\EzRest

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$requestObject eZ\Publish\API\Repository\Values\ValueObject Since there is a need to prepare an object in several steps it needs to be hold until sent to the request body.
$responseObject eZ\Publish\API\Repository\Values\ValueObject | Exception Same idea as the $requestObject, since we need to verify it step by step it need to be stored (as object) for testing.

Открытые методы

Метод Описание
assertHeaderHasObject ( $header, $object )
assertObjectFieldHasValue ( $field, $value )
assertResponseErrorDescription ( $errorDescriptionRegEx )
assertResponseErrorStatusCode ( $code )
assertResponseObject ( string $object )
convertResponseBodyToObject ( string $responseBody, string $contentTypeHeader ) : eZ\Publish\API\Repository\Values\ValueObject Convert the body/content of a response into an object.
getRequestObject ( ) : eZ\Publish\API\Repository\Values\ValueObject Get the request object.
getResponseObject ( ) : eZ\Publish\API\Repository\Values\ValueObject Get the response object (if it's not converted do the conversion also).
iSetTheContentTypeHeaderToInVersion ( $contentType, $version )
makeObject ( $type )
setFieldToEmptyArray ( $field )
setFieldToValue ( $field, $value )
setHeaderWithObject ( $header, $object )

Защищенные методы

Метод Описание
addObjectToRequestBody ( eZ\Publish\API\Repository\Values\ValueObject $object, string $type ) Convert an object and add it to the body/content of the request.
convertObjectTo ( eZ\Publish\API\Repository\Values\ValueObject $object, string $type ) : Response Convert an object to a request.
createRequestObject ( string $objectType ) Create an object of the specified type.
decomposeObjectHeader ( $header ) : false | string Decompose the header to get only the object type of the accept/conten-type headers.
getResponseError ( string $property ) : integer | mixed | string Get property from the returned Exception.
makeObjectHeader ( $object ) Make content-type/accept header with prefix and type.
setRestBodyType ( string $type ) Set body type of requests and responses.

Описание методов

addObjectToRequestBody() защищенный метод

Convert an object and add it to the body/content of the request.
protected addObjectToRequestBody ( eZ\Publish\API\Repository\Values\ValueObject $object, string $type )
$object eZ\Publish\API\Repository\Values\ValueObject Object to be converted
$type string Type for the body of the request (XML, JSON)

assertHeaderHasObject() публичный метод

public assertHeaderHasObject ( $header, $object )

assertObjectFieldHasValue() публичный метод

public assertObjectFieldHasValue ( $field, $value )

assertResponseErrorDescription() публичный метод

public assertResponseErrorDescription ( $errorDescriptionRegEx )

assertResponseErrorStatusCode() публичный метод

assertResponseObject() публичный метод

public assertResponseObject ( string $object )
$object string Object should be the object name with namespace

convertObjectTo() защищенный метод

Convert an object to a request.
protected convertObjectTo ( eZ\Publish\API\Repository\Values\ValueObject $object, string $type ) : Response
$object eZ\Publish\API\Repository\Values\ValueObject Object to be converted
$type string Type for conversion
Результат Symfony\Component\HttpFoundation\Response

convertResponseBodyToObject() публичный метод

Convert the body/content of a response into an object.
public convertResponseBodyToObject ( string $responseBody, string $contentTypeHeader ) : eZ\Publish\API\Repository\Values\ValueObject
$responseBody string Body/content of the response (with the object)
$contentTypeHeader string Value of the content-type header
Результат eZ\Publish\API\Repository\Values\ValueObject

createRequestObject() защищенный метод

Create an object of the specified type.
protected createRequestObject ( string $objectType )
$objectType string the name of the object to be created

decomposeObjectHeader() защищенный метод

Decompose the header to get only the object type of the accept/conten-type headers.
protected decomposeObjectHeader ( $header ) : false | string
Результат false | string Decomposed string if found, false other wise

getRequestObject() публичный метод

Get the request object.
public getRequestObject ( ) : eZ\Publish\API\Repository\Values\ValueObject
Результат eZ\Publish\API\Repository\Values\ValueObject

getResponseError() защищенный метод

Get property from the returned Exception.
protected getResponseError ( string $property ) : integer | mixed | string
$property string Property to return
Результат integer | mixed | string Property

getResponseObject() публичный метод

Get the response object (if it's not converted do the conversion also).
public getResponseObject ( ) : eZ\Publish\API\Repository\Values\ValueObject
Результат eZ\Publish\API\Repository\Values\ValueObject

iSetTheContentTypeHeaderToInVersion() публичный метод

public iSetTheContentTypeHeaderToInVersion ( $contentType, $version )

makeObject() публичный метод

public makeObject ( $type )

makeObjectHeader() защищенный метод

Make content-type/accept header with prefix and type.
protected makeObjectHeader ( $object )

setFieldToEmptyArray() публичный метод

public setFieldToEmptyArray ( $field )

setFieldToValue() публичный метод

public setFieldToValue ( $field, $value )

setHeaderWithObject() публичный метод

public setHeaderWithObject ( $header, $object )

setRestBodyType() защищенный метод

Set body type of requests and responses.
protected setRestBodyType ( string $type )
$type string Type of the REST body

Описание свойств

$requestObject публичное свойство

Since there is a need to prepare an object in several steps it needs to be hold until sent to the request body.
public ValueObject,eZ\Publish\API\Repository\Values $requestObject
Результат eZ\Publish\API\Repository\Values\ValueObject

$responseObject публичное свойство

Same idea as the $requestObject, since we need to verify it step by step it need to be stored (as object) for testing.
public ValueObject,eZ\Publish\API\Repository\Values|Exception,eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext $responseObject
Результат eZ\Publish\API\Repository\Values\ValueObject | Exception