class EntityWrapper extends AbstractWrapper

Class EntityWrapper

Properties

protected object $meta Object metadata from AbstractWrapper
protected object $object Wrapped object from AbstractWrapper
protected ObjectManager $om Object manager instance from AbstractWrapper

Methods

static mixed
wrap(object $object, ObjectManager $om)

Wrap object factory method

static 
clear()

Clear all wrapped object references

object
getObject()

Get currently wrapped object etc.: entity, document

object
getMetadata()

Get metadata

populate(array $data)

Populates the object with given property values

__construct(object $entity, EntityManager $em)

Wrap entity

mixed
getPropertyValue(string $property)

Extract property value from object

setPropertyValue(string $property, mixed $value)

Set the property

bool
hasValidIdentifier()

Checks if identifier is valid

string
getRootObjectName()

Get root object class name

array|mixed
getIdentifier(boolean $single = true)

Get the object identifier, single or composite

bool
isEmbeddedAssociation(string $field)

Checks if association is embedded

initialize()

Initialize the entity if it is proxy required when is detached or not initialized

Details

in AbstractWrapper at line 58
static mixed wrap(object $object, ObjectManager $om)

Wrap object factory method

Parameters

object $object
ObjectManager $om

Return Value

mixed

Exceptions

Exception

in AbstractWrapper at line 69
static clear()

Clear all wrapped object references

in AbstractWrapper at line 80
object getObject()

Get currently wrapped object etc.: entity, document

Return Value

object

in AbstractWrapper at line 90
object getMetadata()

Get metadata

Return Value

object

in AbstractWrapper at line 102
AbstractWrapper populate(array $data)

Populates the object with given property values

Parameters

array $data

Return Value

AbstractWrapper

at line 40
__construct(object $entity, EntityManager $em)

Wrap entity

Parameters

object $entity
EntityManager $em

at line 54
mixed getPropertyValue(string $property)

Extract property value from object

Parameters

string $property

Return Value

mixed

at line 69
EntityWrapper setPropertyValue(string $property, mixed $value)

Set the property

Parameters

string $property
mixed $value

Return Value

EntityWrapper

at line 82
bool hasValidIdentifier()

Checks if identifier is valid

Return Value

bool

at line 92
string getRootObjectName()

Get root object class name

Return Value

string

at line 104
array|mixed getIdentifier(boolean $single = true)

Get the object identifier, single or composite

Parameters

boolean $single

Return Value

array|mixed

at line 143
bool isEmbeddedAssociation(string $field)

Checks if association is embedded

Parameters

string $field

Return Value

bool

at line 151
protected initialize()

Initialize the entity if it is proxy required when is detached or not initialized