Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Add Nested Categories to your models. Models can be grouped into individual categories (this is the default), or multiple models can share a group of categories.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


# sfDoctrineActAsCategorizablePlugin

## Introduction
This behavior permits to assign categories to doctrine models

## Features

 * add a category to an object
 * allows for Nested categories using the Doctrine Nested Set Behavior

 * Overview
		Because multiple unrelated objects can be categorized in a single project, by default this plugin
		separates each individual model assigned this behavior into its own Category set.  This can be
		customized (see below)

 * Other Options: 

You can set the root name of your category (default is the name of the model appended with '_Root')
This is useful when you want two models to have identical directory structures
			Categorizable:		{	root:	Gallery_Root }
				Categorizable:	{	root:	Gallery_Root }
The above models will now pull from the same set of categories
You can change the local ID to another name (default is category_id)
			category_id: 		my_id 

Use the following functions when manipulating your category objects:
#Table Methods
	//Saves the category specified to the appropriate category tree 			
	//Removes the category safely from the category tree.
#Object Methods	
	//Saves the category specified to the appropriate category tree and assigns it to your object
	//assigns the specified category to your object
#Category Methods				

	//returns the assigned parent category (excluding the category tree root)
	//returns a collection of sub categories for the category
	//sets the $child category as a direct descendent of $category
	//sets the $category category as a direct descendent of $parent
#Category Table Methods

	//returns a Category object with the specified name
__*variable is mixed, can either be string or Category types__
## Philosophy of the stuff ##

* categorizable models must have a primary key
* categories are saved when the object is saved

## Get it installed ##

* go to your project's root
* Install the plugin: 

	actAs: [Categorizable] to model you want to be categorized
* rebuild the model: 
	./symfony doctrine-build-all
* clear cache:
	./symfony cc
Something went wrong with that request. Please try again.