steerCMSPropertiesBehaviorPlugin

The properties behavior allows for abstract properties to be added to any propel object - each property is a simple name / value pair.

Adding the Behavior

Activating this plugin is a simple task of adding the following code to your Propel objects class:

sfPropelBehavior::add('steerCMSBlogInstance', array('steerCMSPropelPropertiesBehavior'));

Once that is in place, your object will have access to the following methods:

Methods

  • addProperty: add a single property.
  • addProperties: add a set of properties.
  • deleteProperty: delete a property attached to an object.
  • deleteAllProperties: retrieve all properties attached to an object.
  • getProperty: retrieve a property attached to an object.
  • getAllProperties: retrieve all properties attached to an object.
  • hasProperty: check for a property attached to an object.

Interface and Management

All administrative interfaces are automatically built using the Steer CMS generator. The only thing left to do is link to it from the listing view.

This snippet is taken from the steerCMSBlogPost generator.yml file:

      .....
icon_object_actions:
properties: { name: properties, action: properties }
.....