Download the PHP package iachilles/eavactiverecord without Composer
On this page you can find all versions of the php package iachilles/eavactiverecord. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download iachilles/eavactiverecord
More information about iachilles/eavactiverecord
Files in iachilles/eavactiverecord
Package eavactiverecord
Short Description Implements entity-attribute-value pattern and provides a simple way to work with EAV-attributes.
License MIT
Homepage https://github.com/iAchilles/eavactiverecord
Informations about the package eavactiverecord
EavActiveRecord
Implements entity-attribute-value pattern and provides a simple way to work with EAV-attributes. EAV-attributes are stored in the database as separate records but accessed and searched in such a way as if they were columns in the entity's table.
The following features are supported:
- Eager and lazy loading of EAV-attributes.
- Dynamic validation rules. The validation rules defined for the EAV-attribute will be added to the model dynamically.
- Automatically inserting/updating/deleting EAV-attribute values.
- Accessing and editing EAV-attributes in the same way as if they were real attributes of the model.
- A simple search by EAV-attributes with using the find methods.
Requirements
- Yii 1.1.2 or above
- PHP 5.1 or above
Installation
- Download and extract the release files under the folder "protected/components/eavactiverecord".
- Run the SQL-script mysql.sql or postgresql.sql (if your DBMS is PostgreSQL) It is located in the following folder: "protected/components/eavactiverecord/schema/". It creates tables needed to work with EAV attributes: eav_set, eav_attribute, eav_attribute_set, eav_attribute_date, eav_attribute_int, eav_attribute_varchar, eav_attribute_text.
-
Add the following lines in the file "protected/config/main.php":
-
It requires cache to be activated in the application:
The extension will use own cache component if it is defined as the following:
If you do not use cache, add the following code in the file "protected/config/main.php":
-
Extend your model class from the class EavActiveRecord
-
Call the method Foo::addColumn(). This method must only be called once for each model that extends EavActiveRecord class. It adds the new column "eav_set_id" in the associated database table.
-
Since v1.0.2 it includes the GUI module for user interaction (front-end module) based on the extension API. For detailed information about installing the module, reed the EavModule Installation Guide
The screenshot of the module page is shown below
What's next?
For detailed information on how to use the extension eavactiverecord, please read the following wiki articles: