Latest commit 9ccf6e8 Oct 22, 2017
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Tests Adapt Unit Tests code to PHPUnit 6 Mar 8, 2017
uml Add UNL diagram Aug 21, 2015
Attribute.php PHP7 More Sep 22, 2016
Entity.php PHP7 More Sep 22, 2016
README.rst Fix test name Oct 22, 2017
Value.php PHP7 More Sep 22, 2016

README.rst

Entity-Attribute-Value (EAV)

The Entity–attribute–value (EAV) pattern in order to implement EAV model with PHP.

Purpose

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.

UML Diagram

EAV UML Diagram

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: