The Entity–attribute–value (EAV) pattern in order to implement EAV model with PHP.
The Entity–attribute–value (EAV) model is a data model to describe entities where the number of attributes (properties, parameters) that can be used to describe them is potentially vast, but the number that will actually apply to a given entity is relatively modest.
You can also find this code on GitHub
.. literalinclude:: Entity.php :language: php :linenos:
.. literalinclude:: Attribute.php :language: php :linenos:
.. literalinclude:: Value.php :language: php :linenos:
.. literalinclude:: Tests/EAVTest.php :language: php :linenos: