Download the PHP package tiny-blocks/value-object without Composer
On this page you can find all versions of the php package tiny-blocks/value-object. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tiny-blocks/value-object
More information about tiny-blocks/value-object
Files in tiny-blocks/value-object
Package value-object
Short Description Delimits default behaviors for Value Objects.
License MIT
Homepage https://github.com/tiny-blocks/value-object
Informations about the package value-object
Value Object
- Overview
- Installation
- How to use
- License
- Contributing
Overview
A Value Object (VO) is an immutable type that is only distinguishable by the state of its properties, that is, unlike an entity, which has a unique identifier and remains distinct even if its properties are identical, VOs with the same properties can be considered the same.
Because they are immutable, VOs cannot be changed once created. Modifying one is conceptually the same as discard the old one and create a new one.
More details about VOs.
Installation
How to use
The library exposes available behaviors through the ValueObject
interface, and the implementation of these behaviors
through the ValueObjectAdapter
trait.
Concrete implementation
With the implementation of the ValueObject
interface, and the ValueObjectAdapter
trait, the use of
__get
, __set
and __unset
methods is suppressed, making the object immutable.
Using the equals method
The equals
method compares the value of two VOs, and checks if they are equal.
License
Value Object is licensed under MIT.
Contributing
Please follow the contributing guidelines to contribute to the project.