‪TYPO3CMS  ‪main
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 TYPO3\CMS\Extbase\DomainObject\AbstractEntity TYPO3\CMS\Extbase\DomainObject\AbstractValueObject TYPO3\CMS\Beuser\Domain\Model\BackendUser TYPO3\CMS\Beuser\Domain\Model\BackendUserGroup TYPO3\CMS\Beuser\Domain\Model\FileMount TYPO3\CMS\Extbase\Domain\Model\Category TYPO3\CMS\Extbase\Domain\Model\File TYPO3\CMS\Extbase\Domain\Model\FileReference TYPO3\CMS\Extbase\Domain\Model\Folder TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\Fixtures\HydrationFixtureEntity TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixtures\Entity TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\Routing\Fixtures\EntityFixture TYPO3\CMS\Extbase\Tests\Unit\Persistence\Fixture\Domain\Model\A TYPO3\CMS\Extbase\Tests\Unit\Persistence\Fixture\Domain\Model\Entity 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\Extbase\Tests\Unit\Reflection\Fixture\DummyClassWithAllTypesOfProperties TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\DummyModel TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\Property\DummyEntityWithoutTypeDeclarations TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\Property\DummyEntityWithTypeDeclarations TYPO3\CMS\Extbase\Tests\UnitDeprecated\Reflection\Fixture\DummyModel TYPO3\CMS\Extensionmanager\Domain\Model\Extension TYPO3\CMS\Fluid\Tests\Functional\Fixtures\ViewHelpers\ExtendsAbstractEntity TYPO3Tests\ActionControllerArgumentTest\Domain\Model\Model TYPO3Tests\ActionControllerTest\Domain\Model\Model TYPO3Tests\BlogExample\Domain\Model\Administrator TYPO3Tests\BlogExample\Domain\Model\Blog TYPO3Tests\BlogExample\Domain\Model\Category TYPO3Tests\BlogExample\Domain\Model\Comment TYPO3Tests\BlogExample\Domain\Model\DateExample TYPO3Tests\BlogExample\Domain\Model\DateTimeImmutableExample TYPO3Tests\BlogExample\Domain\Model\FrontendUserGroup TYPO3Tests\BlogExample\Domain\Model\Info TYPO3Tests\BlogExample\Domain\Model\Person TYPO3Tests\BlogExample\Domain\Model\Post TYPO3Tests\BlogExample\Domain\Model\TtContent TYPO3Tests\ParentChildTranslation\Domain\Model\Child TYPO3Tests\ParentChildTranslation\Domain\Model\Main TYPO3Tests\ParentChildTranslation\Domain\Model\Squeeze TYPO3Tests\TestDataMapper\Domain\Model\Example TYPO3Tests\TestDataMapper\Domain\Model\TraversableDomainObjectExample TYPO3Tests\TestIrreForeignfield\Domain\Model\Content TYPO3Tests\TestIrreForeignfield\Domain\Model\Hotel TYPO3Tests\TestIrreForeignfield\Domain\Model\Offer TYPO3Tests\TestIrreForeignfield\Domain\Model\Price TYPO3Tests\TestValidators\Domain\Model\AnotherModel TYPO3Tests\TestValidators\Domain\Model\Model 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 TYPO3Tests\BlogExample\Domain\Model\RegistryEntry TYPO3Tests\BlogExample\Domain\Model\Tag

Public Member Functions

 setPid (int $pid)
 
 _setProperty (string $propertyName, mixed $value)
 
 _getProperty (string $propertyName)
 
 _memorizeCleanState (?string $propertyName=null)
 
 _memorizePropertyCleanState (string $propertyName)
 
 _getCleanProperty (string $propertyName)
 
 _isDirty (?string $propertyName=null)
 
 _isClone ()
 
 _setClone (bool $clone)
 
 __clone ()
 
non empty string __toString ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface
 getUid ()
 
 getPid ()
 
 _isNew ()
 
 _hasProperty (string $propertyName)
 

Public Attributes

const PROPERTY_UID = 'uid'
 
const PROPERTY_PID = 'pid'
 
const PROPERTY_LOCALIZED_UID = '_localizedUid'
 
const PROPERTY_LANGUAGE_UID = '_languageUid'
 
const PROPERTY_VERSIONED_UID = '_versionedUid'
 
int< 1, function getUid():?int { if( $this->uid !==null) { return(int) $this-> uid
 
return null
 
int< 0, function getPid():?int { if( $this->pid===null) { return null;} return(int) $this-> pid
 
array< non-empty-string, function _getProperties():array { $properties=get_object_vars( $this);foreach( $properties as $propertyName=> $propertyValue) { if(str_starts_with( $propertyName, '_')) { unset( $properties[ $propertyName]);} } return $properties;} public function _hasProperty(string $propertyName):bool { return property_exists( $this, $propertyName);} public function _isNew():bool { return $this-> uid === null
 
array< non-empty-string, function _getCleanProperties():array { return $this-> _cleanProperties
 

Protected Member Functions

 isPropertyDirty (mixed $previousValue, mixed $currentValue)
 

Protected Attributes

int $uid = null
 
int $_localizedUid = null
 
int $_languageUid = null
 
int $_versionedUid = null
 
int $pid = null
 

Private Attributes

bool $_isClone = false
 
array $_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.

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 30 of file AbstractDomainObject.php.

Member Function Documentation

◆ __clone()

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

◆ __toString()

◆ _getCleanProperty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_getCleanProperty ( string  $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
non-empty-string$propertyName‪The name of the property to be memorized.

Definition at line 237 of file AbstractDomainObject.php.

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

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

◆ _getProperty()

◆ _isClone()

◆ _isDirty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_isDirty ( ?string  $propertyName = null)

Returns TRUE if the properties were modified after reconstitution

Parameters
non-empty-string | null$propertyName‪An optional name of a property to be checked if its value is dirty
Exceptions
TooDirtyException

Implements TYPO3\CMS\Extbase\Persistence\ObjectMonitoringInterface.

Definition at line 249 of file AbstractDomainObject.php.

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

◆ _memorizeCleanState()

◆ _memorizePropertyCleanState()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_memorizePropertyCleanState ( string  $propertyName)

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

Parameters
non-empty-string$propertyName‪The name of the property to be memorized. If omitted all persistable properties are memorized.

Definition at line 198 of file AbstractDomainObject.php.

References TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_cleanProperties, and TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_getProperty().

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

◆ _setClone()

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

Definition at line 320 of file AbstractDomainObject.php.

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

◆ _setProperty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_setProperty ( string  $propertyName,
mixed  $value 
)

◆ isPropertyDirty()

TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::isPropertyDirty ( mixed  $previousValue,
mixed  $currentValue 
)
protected

Checks the $value against the $cleanState.

Definition at line 274 of file AbstractDomainObject.php.

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

◆ setPid()

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

Member Data Documentation

◆ $_cleanProperties

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

Definition at line 84 of file AbstractDomainObject.php.

◆ $_isClone

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

TRUE if the object is a clone

Definition at line 77 of file AbstractDomainObject.php.

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

◆ $_languageUid

int TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$_languageUid = null
protected

Definition at line 57 of file AbstractDomainObject.php.

◆ $_localizedUid

int TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$_localizedUid = null
protected

◆ $_versionedUid

int TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$_versionedUid = null
protected

The uid of the versioned record.

Todo:
‪make private in 13.0 and expose value via getter

Definition at line 65 of file AbstractDomainObject.php.

◆ $pid

int TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$pid = null
protected

◆ $uid

int TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::$uid = null
protected

◆ _cleanProperties

array<non-empty-string, function _getCleanProperties(): array { return $this-> TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::_cleanProperties

◆ null

return TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::null

Definition at line 94 of file AbstractDomainObject.php.

◆ pid

int<0, function getPid(): ?int { if ($this->pid === null) { return null; } return (int)$this-> TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::pid
Returns
‪int<0, max>|null

Definition at line 113 of file AbstractDomainObject.php.

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

◆ PROPERTY_LANGUAGE_UID

◆ PROPERTY_LOCALIZED_UID

const TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::PROPERTY_LOCALIZED_UID = '_localizedUid'

Definition at line 34 of file AbstractDomainObject.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Backend\attachObjectToParentObjectRelationHasMany(), TYPO3\CMS\Extbase\Tests\Unit\Reflection\ClassSchemaTest\classSchemaGetProperties(), TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\createTypedNamedParameter(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\customFindByUidOverlayDisabled(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\customFindByUidOverlayEnabled(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\findByUidNoOverlaysDefaultLanguage(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\findByUidNoOverlaysLanguage(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\findByUidOverlayModeOnDefaultLanguage(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\findByUidOverlayModeOnLanguage(), TYPO3\CMS\Extbase\Persistence\Generic\Backend\insertObject(), TYPO3\CMS\Extbase\Persistence\Generic\Backend\insertRelationInRelationtable(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\postsWithoutRespectingSysLanguageDataProvider(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\queryFirst5PostsDataProvider(), TYPO3\CMS\Extbase\Tests\Functional\Persistence\QueryLocalizedDataTest\queryPostsByPropertyDataProvider(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\resolveRelationValuesOfField(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\thawProperties(), and TYPO3\CMS\Extbase\Persistence\Generic\Backend\updateObject().

◆ PROPERTY_PID

◆ PROPERTY_UID

◆ PROPERTY_VERSIONED_UID

◆ uid [1/2]

int<1, function getUid(): ?int { if ($this->uid !== null) { return (int)$this-> TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::uid

◆ uid [2/2]

array<non-empty-string, function _getProperties(): array { $properties = get_object_vars($this); foreach ($properties as $propertyName => $propertyValue) { if (str_starts_with($propertyName, '_')) { unset($properties[$propertyName]); } } return $properties; } public function _hasProperty(string $propertyName): bool { return property_exists($this, $propertyName); } public function _isNew(): bool { return $this-> TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject::uid === null
Returns
‪array<non-empty-string, mixed> a hash map of property names and property values.

Definition at line 171 of file AbstractDomainObject.php.