TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
AbstractDomainObject Class Reference
Inheritance diagram for AbstractDomainObject:
DomainObjectInterface ObjectMonitoringInterface AbstractEntity AbstractValueObject Extension Constraint HistoryEntry LogEntry Workspace BackendUserGroup Demand Document DocumentFormat DocumentTranslation AbstractFileCollection AbstractFileFolder BackendUser BackendUserGroup Category FileMount FrontendUser FrontendUserGroup ConfigurationCategory ConfigurationItem ConfigurationSubcategory Dependency Extension Mirrors Repository ExtendsAbstractEntity Element ValidationElement Extension Language SysNote

Public Member Functions

 __wakeup ()
 
 getUid ()
 
 setPid ($pid)
 
 getPid ()
 
 _setProperty ($propertyName, $propertyValue)
 
 _getProperty ($propertyName)
 
 _getProperties ()
 
 _hasProperty ($propertyName)
 
 _isNew ()
 
 _memorizeCleanState ($propertyName=null)
 
 _memorizePropertyCleanState ($propertyName)
 
 _getCleanProperties ()
 
 _getCleanProperty ($propertyName)
 
 _isDirty ($propertyName=null)
 
 _isClone ()
 
 _setClone ($clone)
 
 __clone ()
 
 __toString ()
 
- Public Member Functions inherited from ObjectMonitoringInterface
 _memorizeCleanState ()
 
 _isDirty ()
 

Protected Member Functions

 isPropertyDirty ($previousValue, $currentValue)
 

Protected Attributes

 $uid
 
 $_localizedUid
 
 $_languageUid
 
 $_versionedUid
 
 $pid
 

Private Attributes

 $_isClone = false
 
 $_cleanProperties = array()
 

Detailed Description

A generic Domain Object.

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

Definition at line 24 of file AbstractDomainObject.php.

Member Function Documentation

__clone ( )

Clone method. Sets the _isClone property.

Returns
void

Definition at line 336 of file AbstractDomainObject.php.

References AbstractDomainObject\_isClone().

__toString ( )

Returns the class name and the uid of the object as string

Returns
string

Definition at line 346 of file AbstractDomainObject.php.

Referenced by AbstractValueObject\getValue().

__wakeup ( )

This is the magic __wakeup() method. It's invoked by the unserialize statement in the reconstitution process of the object. If you want to implement your own __wakeup() method in your Domain Object you have to call parent::__wakeup() first!

Returns
void
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. Objects are instantiated differently calling parent::__wakeup() is no longer necessary.

Definition at line 71 of file AbstractDomainObject.php.

References GeneralUtility\logDeprecatedFunction().

_getCleanProperties ( )

Returns a hash map of clean properties and $values.

Returns
array

Definition at line 238 of file AbstractDomainObject.php.

References AbstractDomainObject\$_cleanProperties.

Referenced by AbstractDomainObject\_isDirty().

_getCleanProperty (   $propertyName)

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.

Parameters
string$propertyNameThe name of the property to be memorized.
Returns
mixed The clean property value or NULL

Implements DomainObjectInterface.

Definition at line 250 of file AbstractDomainObject.php.

Referenced by AbstractDomainObject\_isDirty().

_getProperties ( )

Returns a hash map of property names and property values. Only for internal use.

Returns
array The properties

Implements DomainObjectInterface.

Definition at line 151 of file AbstractDomainObject.php.

_getProperty (   $propertyName)

Returns the property value of the given property name. Only for internal use.

Parameters
string$propertyName
Returns
mixed The propertyValue

Implements DomainObjectInterface.

Definition at line 141 of file AbstractDomainObject.php.

_hasProperty (   $propertyName)

Returns the property value of the given property name. Only for internal use.

Parameters
string$propertyName
Returns
bool TRUE bool true if the property exists, FALSE if it doesn't exist or NULL in case of an error.

Definition at line 168 of file AbstractDomainObject.php.

Referenced by AbstractDomainObject\_setProperty().

_isClone ( )

Returns TRUE if the object has been clonesd, cloned, FALSE otherwise.

Returns
bool TRUE if the object has been cloned

Definition at line 313 of file AbstractDomainObject.php.

References AbstractDomainObject\$_isClone.

Referenced by AbstractDomainObject\__clone(), and AbstractDomainObject\_setClone().

_isDirty (   $propertyName = null)

Returns TRUE if the properties were modified after reconstitution

Parameters
string$propertyNameAn optional name of a property to be checked if its value is dirty
Exceptions
\TYPO3\CMS\Extbase\Persistence\Generic\Exception\TooDirtyException
Returns
bool

Definition at line 262 of file AbstractDomainObject.php.

References AbstractDomainObject\_getCleanProperties(), AbstractDomainObject\_getCleanProperty(), and AbstractDomainObject\isPropertyDirty().

_isNew ( )

Returns TRUE if the object is new (the uid was not set, yet). Only for internal use

Returns
bool

Implements DomainObjectInterface.

Definition at line 178 of file AbstractDomainObject.php.

_memorizeCleanState (   $propertyName = null)

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

Parameters
string$propertyNameThe name of the property to be memorized. If omitted all persistable properties are memorized.
Returns
void

Definition at line 190 of file AbstractDomainObject.php.

References AbstractDomainObject\_memorizePropertyCleanState().

_memorizePropertyCleanState (   $propertyName)

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

Parameters
string$propertyNameThe name of the property to be memorized. If omittet all persistable properties are memorized.
Returns
void

Definition at line 214 of file AbstractDomainObject.php.

Referenced by AbstractDomainObject\_memorizeCleanState().

_setClone (   $clone)

Setter whether this Domain Object is a clone of another one. 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
bool$clone

Definition at line 326 of file AbstractDomainObject.php.

References AbstractDomainObject\_isClone().

_setProperty (   $propertyName,
  $propertyValue 
)

Reconstitutes a property. Only for internal use.

Parameters
string$propertyName
mixed$propertyValue
Returns
bool

Implements DomainObjectInterface.

Definition at line 126 of file AbstractDomainObject.php.

References AbstractDomainObject\_hasProperty().

getPid ( )

Getter for the pid.

Returns
int The pid or NULL if none set yet.

Implements DomainObjectInterface.

Definition at line 110 of file AbstractDomainObject.php.

References AbstractDomainObject\$pid.

getUid ( )
isPropertyDirty (   $previousValue,
  $currentValue 
)
protected

Checks the $value against the $cleanState.

Parameters
mixed$previousValue
mixed$currentValue
Returns
bool

Definition at line 289 of file AbstractDomainObject.php.

References elseif.

Referenced by AbstractDomainObject\_isDirty().

setPid (   $pid)

Setter for the pid.

Parameters
int | NULL$pid
Returns
void

Implements DomainObjectInterface.

Definition at line 96 of file AbstractDomainObject.php.

References AbstractDomainObject\$pid.

Member Data Documentation

$_cleanProperties = array()
private

Definition at line 61 of file AbstractDomainObject.php.

Referenced by AbstractDomainObject\_getCleanProperties().

$_isClone = false
private

Definition at line 56 of file AbstractDomainObject.php.

Referenced by AbstractDomainObject\_isClone().

$_languageUid
protected

Definition at line 39 of file AbstractDomainObject.php.

$_localizedUid
protected

Definition at line 34 of file AbstractDomainObject.php.

$_versionedUid
protected

Definition at line 44 of file AbstractDomainObject.php.

$pid
protected
$uid
protected

Definition at line 29 of file AbstractDomainObject.php.

Referenced by AbstractDomainObject\getUid().