Constants

FLAG_ABSTRACT

FLAG_ABSTRACT

DESCRIPTORCLASS

DESCRIPTORCLASS

IDFIELD

IDFIELD

VERSION

VERSION

Properties

$class

$class : string

The class associated to this entity

Type

string

$name

$name : string

The entity's name

Type

string

$version

$version : integer

The entity's version

Type

integer

$fields

$fields : array<mixed,\Orpheus\EntityDescriptor\Field>

The fields of this entity

Type

array<mixed,\Orpheus\EntityDescriptor\Field>

$indexes

$indexes : array<mixed,string>

The indexes of this entity

Type

array<mixed,string>

$abstract

$abstract : boolean

Is this entity abstract ?

Type

boolean

$types

$types : array

All known types

Type

array

Methods

getAllEntityDescriptors()

getAllEntityDescriptors() : array<mixed,\Orpheus\EntityDescriptor\EntityDescriptor>

Get all available entity descriptor

Returns

array<mixed,\Orpheus\EntityDescriptor\EntityDescriptor>

getAllEntities()

getAllEntities() : array<mixed,string>

Get all available entities

Returns

array<mixed,string>

load()

load(string  $name, string  $class = null) : \Orpheus\EntityDescriptor\EntityDescriptor

Load an entity descriptor from configuraiton file

Parameters

string $name
string $class

Throws

\Exception

Returns

\Orpheus\EntityDescriptor\EntityDescriptor

isAbstract()

isAbstract() : boolean

Is this entity abstract ?

Returns

boolean —

True if abstract

setAbstract()

setAbstract(  $abstract) : \Orpheus\EntityDescriptor\EntityDescriptor

Set the abstract property of this entity

Parameters

$abstract

Returns

\Orpheus\EntityDescriptor\EntityDescriptor

the descriptor

getName()

getName() : string

Get the name of the entity

Returns

string —

The name of the descriptor

getIndexes()

getIndexes() : array<mixed,\Orpheus\EntityDescriptor\stdClass>

Get all indexes

Returns

array<mixed,\Orpheus\EntityDescriptor\stdClass>

getFieldsName()

getFieldsName() : array<mixed,string>

Get fields' name

Returns

array<mixed,string>

validateFieldValue()

validateFieldValue(string  $fieldName, mixed  $value,   $input = array(), \Orpheus\EntityDescriptor\PermanentEntity  $ref = null) 

Validate a value for a specified field, an exception is thrown if the value is invalid

Parameters

string $fieldName

The field to use

mixed $value

input|output value to validate for this field

$input

string[]

\Orpheus\EntityDescriptor\PermanentEntity $ref

Throws

\Orpheus\Publisher\Exception\InvalidFieldException

validate()

validate(array  $input, array  $fields = null, \Orpheus\EntityDescriptor\PermanentEntity  $ref = null, integer  $errCount) : array

Validate input

Parameters

array $input
array $fields
\Orpheus\EntityDescriptor\PermanentEntity $ref
integer $errCount

Returns

array

getType()

getType(string  $name, string  $type = null) : \Orpheus\EntityDescriptor\TypeDescriptor

Get a type by name

Parameters

string $name

Name of the type to get

string $type

Output parameter for type

Throws

\Exception

Returns

\Orpheus\EntityDescriptor\TypeDescriptor

parseType()

parseType(string  $fieldName, string  $desc) : \Orpheus\EntityDescriptor\StdClass

parse type from configuration string

Parameters

string $fieldName
string $desc

Throws

\Exception

Returns

\Orpheus\EntityDescriptor\StdClass

__construct()

__construct(  $name,   $fields,   $indexes,   $class = null) 

Construct the entity descriptor

Parameters

$name

string

$fields

FieldDescriptor[]

$indexes

stdClass[]

$class

string