Persistence · Question 5 of 12

How does an entity differ from a value object in an Extbase domain model?

1 answer is correct. Easy

Show answer

Answer

  • A An entity has its own identity (UID), a value object is defined solely by its values

Explanation

An entity remains "the same object" even when its properties change – a conference with UID 42 stays that conference even if its title changes. A value object has no identity: two colours with the same name and hex value are equal and interchangeable; typical examples are amounts of money, date ranges or coordinates. Value objects are immutable; instead of changing them, you replace them with a new object. In TYPO3 v14 you write them as plain PHP classes and store their values as columns of the owning entity; the class AbstractValueObject is marked @internal and should not be extended.

Certifications & exams

Which exam comes next?

You can already practise for 19 exams, and 21 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications