A CakePHP plugin that provides arbitrary metadata storage for model records
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Model
Test
.gitignore
LICENSE
README.mdown

README.mdown

Metadata Plugin for CakePHP 2.0+

Metadata provides storage of arbitrary n-deep arrays of data related to a particular model record

Installation

  • Clone/Copy the files in this directory into app/plugins/metadata

  • Include the metadata behavior in the models you wish to have metadata: var $actsAs = array('Metadata.Metadata' => array( 'validate' => array( 'fieldName' => array( 'rule' => 'postal', 'message' => 'Must be valid postal code', ), 'some' => array( 'nested' => array( 'array' => array( array( 'rule' => 'numeric', 'message' => 'Must be numeric' ), array( 'rule' => array( 'decimal', 2 ), 'message' => 'Must be decimal' ) ) ) ) ) ));

  • Define any validation rules that you need, in a similar fashion to model validation rules (all the built-in Validator rules work). Multiple rules per node are supported, and nodes can be as deep as required.

Documentation

Further documentation including additional ways of configuring Metadata can be found here.

Reporting issues

If you have any issues with Metadata please open a ticket on the github issue tracker

Contributing

If you'd like to contribute to Metadata, feel free to fork the project and submit patches!