TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject:
TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface TYPO3\CMS\Extbase\Persistence\ObjectMonitoringInterface t3lib_object_tests_initializable TYPO3\CMS\Extbase\DomainObject\AbstractEntity TYPO3\CMS\Extbase\DomainObject\AbstractValueObject ExtbaseTeam\BlogExample\Domain\Model\Blog ExtbaseTeam\BlogExample\Domain\Model\Comment ExtbaseTeam\BlogExample\Domain\Model\DateExample ExtbaseTeam\BlogExample\Domain\Model\Person ExtbaseTeam\BlogExample\Domain\Model\Post ExtbaseTeam\BlogExample\Domain\Model\TtContent OliverHader\IrreTutorial\Domain\Model\Content OliverHader\IrreTutorial\Domain\Model\Hotel OliverHader\IrreTutorial\Domain\Model\Offer OliverHader\IrreTutorial\Domain\Model\Price TYPO3\CMS\About\Domain\Model\Extension TYPO3\CMS\Belog\Domain\Model\Constraint TYPO3\CMS\Belog\Domain\Model\HistoryEntry TYPO3\CMS\Belog\Domain\Model\LogEntry TYPO3\CMS\Belog\Domain\Model\Workspace TYPO3\CMS\Beuser\Domain\Model\BackendUserGroup TYPO3\CMS\Beuser\Domain\Model\Demand TYPO3\CMS\Documentation\Domain\Model\Document TYPO3\CMS\Documentation\Domain\Model\DocumentFormat TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation TYPO3\CMS\Extbase\Domain\Model\AbstractFileCollection TYPO3\CMS\Extbase\Domain\Model\AbstractFileFolder TYPO3\CMS\Extbase\Domain\Model\BackendUser TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup TYPO3\CMS\Extbase\Domain\Model\Category TYPO3\CMS\Extbase\Domain\Model\FileMount TYPO3\CMS\Extbase\Domain\Model\FrontendUser TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup TYPO3\CMS\Extbase\Tests\Fixture\Entity TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\Routing\Fixtures\EntityFixture TYPO3\CMS\Extbase\Tests\Unit\Persistence\Fixture\Model\Entity2 TYPO3\CMS\Extbase\Tests\Unit\Persistence\Fixture\Model\Entity3 TYPO3\CMS\Extbase\Tests\Unit\Property\TypeConverter\Fixtures\PersistentObjectEntityFixture TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationCategory TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationSubcategory TYPO3\CMS\Extensionmanager\Domain\Model\Dependency TYPO3\CMS\Extensionmanager\Domain\Model\Extension TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors TYPO3\CMS\Extensionmanager\Domain\Model\Repository TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures\ExtendsAbstractEntity TYPO3\CMS\Form\Domain\Model\Element TYPO3\CMS\Form\Domain\Model\ValidationElement TYPO3\CMS\Lang\Domain\Model\Extension TYPO3\CMS\Lang\Domain\Model\Language TYPO3\CMS\SysNote\Domain\Model\SysNote ExtbaseTeam\BlogExample\Domain\Model\Tag TYPO3\CMS\Extbase\Tests\Fixture\ValueObject TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\Routing\Fixtures\ValueObjectFixture TYPO3\CMS\Extbase\Tests\Unit\Property\TypeConverter\Fixtures\PersistentObjectValueObjectFixture

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 TYPO3\CMS\Extbase\Persistence\ObjectMonitoringInterface
 _memorizeCleanState ()
 
 _isDirty ()
 

Protected Member Functions

 isPropertyDirty ($previousValue, $currentValue)
 

Protected Attributes

 $uid
 
 $_localizedUid
 
 $_languageUid
 
 $_versionedUid
 
 $pid
 

Private Attributes

 $_isClone = false
 
 $_cleanProperties = []
 

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()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::__clone ( )

Clone method. Sets the _isClone property.

Returns
void

Definition at line 336 of file AbstractDomainObject.php.

References TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_isClone().

◆ __toString()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::__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 TYPO3\CMS\Extbase\DomainObject\AbstractValueObject\getValue().

◆ __wakeup()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::__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 TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction().

◆ _getCleanProperties()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_getCleanProperties ( )

Returns a hash map of clean properties and $values.

Returns
array

Definition at line 238 of file AbstractDomainObject.php.

References TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\$_cleanProperties.

Referenced by TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_isDirty().

◆ _getCleanProperty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_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 TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface.

Definition at line 250 of file AbstractDomainObject.php.

Referenced by TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_isDirty().

◆ _getProperties()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_getProperties ( )

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

Returns
array The properties

Implements TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface.

Definition at line 151 of file AbstractDomainObject.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getUidOfAlreadyPersistedValueObject().

◆ _getProperty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_getProperty (   $propertyName)

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

Parameters
string$propertyName
Returns
mixed The propertyValue

Implements TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface.

Definition at line 141 of file AbstractDomainObject.php.

◆ _hasProperty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_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 TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_setProperty().

◆ _isClone()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_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 TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\$_isClone.

Referenced by TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\__clone(), and TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_setClone().

◆ _isDirty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_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

Definition at line 262 of file AbstractDomainObject.php.

References TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_getCleanProperties(), TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_getCleanProperty(), and TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\isPropertyDirty().

◆ _isNew()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_isNew ( )

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

Returns
bool

Implements TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface.

Definition at line 178 of file AbstractDomainObject.php.

◆ _memorizeCleanState()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_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 TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_memorizePropertyCleanState().

◆ _memorizePropertyCleanState()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_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 TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_memorizeCleanState().

◆ _setClone()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_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 TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_isClone().

◆ _setProperty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_setProperty (   $propertyName,
  $propertyValue 
)

Reconstitutes a property. Only for internal use.

Parameters
string$propertyName
mixed$propertyValue
Returns
bool

Implements TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface.

Definition at line 126 of file AbstractDomainObject.php.

References TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_hasProperty().

◆ getPid()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::getPid ( )

Getter for the pid.

Returns
int The pid or NULL if none set yet.

Implements TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface.

Definition at line 110 of file AbstractDomainObject.php.

References TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\$pid.

◆ getUid()

◆ isPropertyDirty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::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.

Referenced by TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_isDirty().

◆ setPid()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::setPid (   $pid)

Setter for the pid.

Parameters
int | NULL$pid
Returns
void

Implements TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface.

Definition at line 96 of file AbstractDomainObject.php.

References TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\$pid.

Member Data Documentation

◆ $_cleanProperties

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$_cleanProperties = []
private

◆ $_isClone

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$_isClone = false
private

◆ $_languageUid

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$_languageUid
protected

Definition at line 39 of file AbstractDomainObject.php.

◆ $_localizedUid

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$_localizedUid
protected

Definition at line 34 of file AbstractDomainObject.php.

◆ $_versionedUid

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$_versionedUid
protected

Definition at line 44 of file AbstractDomainObject.php.

◆ $pid

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$pid
protected

◆ $uid

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$uid
protected