AbstractDomainObject

abstract class \TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject

Implements
DomainObjectInterface

A generic Domain Object.

All Model domain objects need to inherit from either AbstractEntity or AbstractValueObject (instead of from this class), as this provides important framework information.

Table of Contents

Interfaces

DomainObjectInterface
A Domain Object Interface. All domain objects which should be persisted need to implement this interface.

Constants

PROPERTY_LANGUAGE_UID  : string = '_languageUid'
PROPERTY_LOCALIZED_UID  : string = '_localizedUid'
PROPERTY_PID  : string = 'pid'
PROPERTY_UID  : string = 'uid'
PROPERTY_VERSIONED_UID  : string = '_versionedUid'

Properties

$_languageUid  : int<-1, max>|null
$_localizedUid  : int<0, max>|null
$_versionedUid  : int|null
The uid of the versioned record.
$pid  : int<0, max>|null
$uid  : int<1, max>|null

Methods

__clone()  : void
__serialize()  : array
A lazy entity is explicitly initialized before its state is collected: The engine's serializer must never trigger the initialization of a lazy object during its traversal, as that corrupts back references within the serialized payload.
__toString()  : non-empty-string
__unserialize()  : void
_getCleanProperties()  : array<non-empty-string, mixed>
Returns a hash map of clean properties and $values.
_getCleanProperty()  : mixed
Returns the clean value of the given property. The returned value will be NULL if the clean state was not memorized before, or if the clean value is NULL.
_getProperties()  : array<non-empty-string, mixed>
_getProperty()  : mixed
_hasProperty()  : bool
_isClone()  : bool
_isDirty()  : bool
Returns TRUE if the properties were modified after reconstitution
_isNew()  : bool
Returns TRUE if the object is new (the uid was not set, yet)
_memorizeCleanState()  : void
Register an object's clean state, e.g. after it has been reconstituted from the database.
_memorizePropertyCleanState()  : void
Register a property's clean state, e.g. after it has been reconstituted from the database.
_setClone()  : mixed
Setter whether this Domain Object is a clone of another one.
_setProperty()  : bool
getPid()  : int<0, max>|null
getUid()  : int<1, max>|null
setPid()  : void
isPropertyDirty()  : bool
Checks the $value against the $cleanState.

Constants

PROPERTY_LANGUAGE_UID

public string PROPERTY_LANGUAGE_UID = '_languageUid'

PROPERTY_LOCALIZED_UID

public string PROPERTY_LOCALIZED_UID = '_localizedUid'

PROPERTY_PID

public string PROPERTY_PID = 'pid'

PROPERTY_UID

public string PROPERTY_UID = 'uid'

PROPERTY_VERSIONED_UID

public string PROPERTY_VERSIONED_UID = '_versionedUid'

Properties

$_languageUid

protected int<-1, max>|null $_languageUid = null

The uid of the language of the object. This is the id of the corresponding sing language.

Tags

todo

make private in 13.0 and expose value via getter

$_localizedUid

protected int<0, max>|null $_localizedUid = null

The uid of the localized record. Holds the uid of the record in default language (the translationOrigin).

Tags

todo

make private in 13.0 and expose value via getter

$_versionedUid

The uid of the versioned record.

protected int|null $_versionedUid = null

Tags

todo

make private in 13.0 and expose value via getter

$pid

protected int<0, max>|null $pid = null

The id of the page the record is "stored".

$uid

protected int<1, max>|null $uid = null

The uid of the record. The uid is only unique in the context of the database table.

Methods

__serialize()

A lazy entity is explicitly initialized before its state is collected: The engine's serializer must never trigger the initialization of a lazy object during its traversal, as that corrupts back references within the serialized payload.

public __serialize() : array

Return values

array

__toString()

public __toString() : non-empty-string

Return values

non-empty-string

__unserialize()

public __unserialize(array $data) : void

Parameters

$data : array

_getCleanProperties()

Returns a hash map of clean properties and $values.

public _getCleanProperties() : array<non-empty-string, mixed>

Return values

array<non-empty-string, mixed>

_getCleanProperty()

Returns the clean value of the given property. The returned value will be NULL if the clean state was not memorized before, or if the clean value is NULL.

public _getCleanProperty(non-empty-string $propertyName) : mixed

Parameters

$propertyName : non-empty-string

The name of the property to be memorized.

Return values

mixed —

The clean property value or NULL

_getProperties()

public _getProperties() : array<non-empty-string, mixed>

Return values

array<non-empty-string, mixed> —

a hash map of property names and property values.

_getProperty()

public _getProperty(string $propertyName) : mixed

Parameters

$propertyName : string

_hasProperty()

public _hasProperty(non-empty-string $propertyName) : bool

Parameters

$propertyName : non-empty-string

Return values

bool

_isClone()

public _isClone() : bool

Return values

bool

_isDirty()

Returns TRUE if the properties were modified after reconstitution

public _isDirty([non-empty-string|null $propertyName = null ]) : bool

Parameters

$propertyName : non-empty-string|null = null

An optional name of a property to be checked if its value is dirty

Tags

throws
TooDirtyException

Return values

bool

_isNew()

Returns TRUE if the object is new (the uid was not set, yet)

public _isNew() : bool

Return values

bool

_memorizeCleanState()

Register an object's clean state, e.g. after it has been reconstituted from the database.

public _memorizeCleanState([non-empty-string|null $propertyName = null ]) : void

Parameters

$propertyName : non-empty-string|null = null

The name of the property to be memorized. If omitted all persistable properties are memorized.

_memorizePropertyCleanState()

Register a property's clean state, e.g. after it has been reconstituted from the database.

public _memorizePropertyCleanState(non-empty-string $propertyName) : void

Parameters

$propertyName : non-empty-string

The name of the property to be memorized. If omitted all persistable properties are memorized.

_setClone()

Setter whether this Domain Object is a clone of another one.

public _setClone(bool $clone) : mixed

NEVER SET THIS PROPERTY DIRECTLY. We currently need it to make the _isDirty check inside AbstractEntity work, but it is just a work- around right now.

Parameters

$clone : bool

_setProperty()

public _setProperty(string $propertyName, mixed $value) : bool

Parameters

$propertyName : string
$value : mixed

Return values

bool

getPid()

public getPid() : int<0, max>|null

Return values

int<0, max>|null

getUid()

public getUid() : int<1, max>|null

Return values

int<1, max>|null

setPid()

public setPid(int<0, max> $pid) : void

Parameters

$pid : int<0, max>

isPropertyDirty()

Checks the $value against the $cleanState.

protected isPropertyDirty(mixed $previousValue, mixed $currentValue) : bool

Parameters

$previousValue : mixed
$currentValue : mixed

Return values

bool
On this page