csDoctrineActAsCategorizablePlugin
1.0.0stable
for sf 1.1 MIT
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.
Sponsored By Centre{source} interactive agency
Developers
| Name |
Status |
Email |
Brent Shaffer |
lead |
moc.ecruosertnec <<ta>> reffahsb
|
License
Copyright (c) 2009 Brent Shaffer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Releases for sf 1.1
| Version |
License |
API |
Released |
|
1.0.0stable
|
MIT license |
1.0.0stable
|
25/04/2009 |
Changelog for release 1.0.0 - 25/04/2009
- Initial creation of plugin
Other releases
Release 1.0.0 - 25/04/2009
- Initial creation of plugin
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
Photos:
actAs:
Categorizable: { root: Gallery_Root }
Videos:
actAs:
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)
actAs:
Categorizable:
category_id: my_id
Use the following functions when manipulating your category objects:
Table Methods
//Saves the category specified to the appropriate category tree
$objectTable->addCategory($category*)
//Removes the category safely from the category tree.
$objectTable->removeCategory($category)
Object Methods
//Saves the category specified to the appropriate category tree and assigns it to your object
$object->addCategory($category*)
//assigns the specified category to your object
$object->setCategory($category*)
Category Methods
//returns the assigned parent category (excluding the category tree root)
$category->getParentCategory()
//returns a collection of sub categories for the category
$category->getSubCategories()
//sets the $child category as a direct descendent of $category
$category->setSubCategory($child*)
//sets the $category category as a direct descendent of $parent
$category->setParentCategory($parent*)
Category Table Methods
//returns a Category object with the specified name
$categoryTable->getCategory($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