Public Member Functions | Public Attributes | Static Public Attributes

Category Class Reference

Category model. More...

Inheritance diagram for Category:
BEAppModel AppModel

List of all members.

Public Member Functions

 afterFind ($result)
 tagLabelPresent ($label, $exclude_id=null)
 tagLabelFromName ($name)
 Get tag label from unique name.
 uniqueLabelName ($label)
 Define a unique name from label: lowercase, trimmed, etc...
 beforeValidate ()
 Define default values.
 getCategoriesByArea ($objectType)
 Get all categories of some object type and order them by area.
 objectCategories ($objectTypeId)
 Get all categories defined for object type id.
 saveTagList ($tagList)
 save a list of comma separated tag
 getTags (array $options=array())
 return list of tags with their weight
 getContentsByTag ($name)
 checkMediaType ($object_type_id, $mediatype)
 USED for multimedia objects check if exists $mediatype in categories for an object type.
 findCreateCategories (array &$names, $objTypeId)
 Search for category names, create if not already present, and return array of corresponding id.
 addObjectCategory ($categoryId, $objectId)
 Add category to object usgin both category and object id.
 appendMediatype (array $objects, $options=array())
 append mediatype to objects array
 categoryId ($name, $objectTypeId)
 Get category id from name and object type id.

Public Attributes

 $actsAs
 $validate

Static Public Attributes

static $dirTag
static $orderTag

Detailed Description

Category model.

Definition at line 26 of file category.php.


Member Function Documentation

Category::addObjectCategory ( categoryId,
objectId 
)

Add category to object usgin both category and object id.

Returns:
true on success, false on failure

Definition at line 543 of file category.php.

Category::appendMediatype ( array $  objects,
options = array() 
)

append mediatype to objects array

Parameters:
array $objects
array $options

Definition at line 567 of file category.php.

Category::categoryId ( name,
objectTypeId 
)

Get category id from name and object type id.

Parameters:
$name,string unique name of category
$objectTypeId,int object type id
Returns:
proerty id on success, null if no proerty id was found

Definition at line 587 of file category.php.

Category::checkMediaType ( object_type_id,
mediatype 
)

USED for multimedia objects check if exists $mediatype in categories for an object type.

If not, create the category

Parameters:
int $object_type_id
Returns:
mixed, false if not mediatype in the form else return array of Category

Definition at line 462 of file category.php.

Category::findCreateCategories ( array &$  names,
objTypeId 
)

Search for category names, create if not already present, and return array of corresponding id.

Parameters:
array $names, category names to search/create
int $objTypeId, category object type id
Returns:
array of corresponding id-category

Definition at line 516 of file category.php.

Category::getCategoriesByArea ( objectType  ) 

Get all categories of some object type and order them by area.

Parameters:
int $objectType
Returns:
array( "area" => array( nomearea => array(categories in that area)), "noarea" => array(categories aren't in any area) )

Definition at line 173 of file category.php.

Category::getTags ( array $  options = array()  ) 

return list of tags with their weight

Parameters:
array $options "showOrphans" => true, show all tags also not associated "status" => null, string or array (on, off, draft). if area_id is setted "status" is used also to related objects "cloud" => false, true to set a css class for cloud view "coeff" => 12, coeffiecient for calculate the distribution "order" => "label", order by field "dir" => 1, asc(1), desc(0) "area_id"=> null get tags only associated to objects that are in "area_id" publication
Returns:
array

Definition at line 279 of file category.php.

Category::objectCategories ( objectTypeId  ) 

Get all categories defined for object type id.

Parameters:
int $objectType
Returns:
array of ( "area" => array( nomearea => array(categories in that area)), "noarea" => array(categories aren't in any area) )

Definition at line 210 of file category.php.

Category::saveTagList ( tagList  ) 

save a list of comma separated tag

Parameters:
comma separated string $tagList
Returns:
array of tags' id

Definition at line 232 of file category.php.

Category::tagLabelFromName ( name  ) 

Get tag label from unique name.

Parameters:
string $name

Definition at line 69 of file category.php.

Category::uniqueLabelName ( label  ) 

Define a unique name from label: lowercase, trimmed, etc...

Parameters:
string $label

Definition at line 81 of file category.php.

Referenced by beforeValidate().


Member Data Documentation

Category::$actsAs
Initial value:
 array(
            'CompactResult'         => array()
    )

Reimplemented from BEAppModel.

Definition at line 27 of file category.php.

Category::$validate
Initial value:
 array(
        'label' => array(
            'rule' => 'notEmpty'
        ),
        'status' => array(
            'rule' => 'notEmpty'
        ),
        'name' => array(
            'rule' => 'notEmpty'
        )
    )

Definition at line 31 of file category.php.


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:46 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus