2019-08-31 14:31:01 +02:00
..
2019-08-31 13:42:46 +02:00
2019-08-31 14:31:01 +02:00
2017-10-22 16:46:38 +03:00
2019-08-31 14:31:01 +02:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

`Entity-Attribute-Value (EAV)`__
================================

The Entityattributevalue (EAV) pattern in order to implement EAV model with PHP.

Purpose
-------

The Entityattributevalue (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.

UML Diagram
-----------

.. image:: uml/uml.png
   :alt: EAV UML Diagram
   :align: center

Code
----

You can also find this code on `GitHub`_

Entity.php

.. literalinclude:: Entity.php
    :language: php
    :linenos:

Attribute.php

.. literalinclude:: Attribute.php
   :language: php
   :linenos:

Value.php

.. literalinclude:: Value.php
    :language: php
    :linenos:

Test
----

Tests/EAVTest.php

.. literalinclude:: Tests/EAVTest.php
   :language: php
   :linenos:

.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/More/EAV
.. __: https://en.wikipedia.org/wiki/Entityattributevalue_model