Public Member Functions | Public Attributes

BEObject Class Reference

BEObject class. More...

Inheritance diagram for BEObject:
BEAppModel AppModel

List of all members.

Public Member Functions

 afterFind ($result)
 Format object data (ObjectProperty, Tag, Category, LangText, Permission).
 beforeSave ()
 afterSave ()
 Save hasMany relations data.
 beforeValidate ()
 Define default values.
 findObjectTypeId ($id)
 isFixed ($id)
 Is object fixed??
 getType ($id)
 Model name/type from id.
 updateTitleDescription ($id, $title, $description)
 Update title and description only.
 objectId ($val)
 Get object id from an identifier that could be an id or nickname.
 getIdFromNickname ($nickname, $status=null)
 Get object id from unique name.
 getNicknameFromId ($id)
 Get object nickname from id.
 getPoster ($id=null, $relations=array('poster', 'attach'))
 Get an image id and uri that can be used as a poster of the one represented by the $id Search in the relations expressed by $relations.

Public Attributes

 $actsAs = array('Cacheable')
 $name = 'BEObject'
 $useTable = "objects"
 $validate
 $belongsTo
 $hasMany
 $hasAndBelongsToMany

Detailed Description

BEObject class.

Definition at line 26 of file b_e_object.php.


Member Function Documentation

BEObject::afterFind ( result  ) 

Format object data (ObjectProperty, Tag, Category, LangText, Permission).

If ObjectProperty is populated a simplified customProperties array (useful in frontend apps) is built as

"customProperties" => array( "prop_name" => "prop_val", "prop_name_multiple_choice" => array("prop_val_1", "prop_val_2") )

Definition at line 156 of file b_e_object.php.

BEObject::getIdFromNickname ( nickname,
status = null 
)

Get object id from unique name.

Parameters:
string $nickname

Definition at line 797 of file b_e_object.php.

Referenced by objectId().

BEObject::getNicknameFromId ( id  ) 

Get object nickname from id.

Parameters:
integer $id

Definition at line 815 of file b_e_object.php.

BEObject::getPoster ( id = null,
relations = array('poster', 'attach') 
)

Get an image id and uri that can be used as a poster of the one represented by the $id Search in the relations expressed by $relations.

Parameters:
int|string $id
array 
Returns:
array

Definition at line 826 of file b_e_object.php.

BEObject::getType ( id  ) 

Model name/type from id.

Parameters:
unknown_type $id

Definition at line 604 of file b_e_object.php.

BEObject::isFixed ( id  ) 

Is object fixed??

Parameters:
int $id
Returns:
boolean

Definition at line 594 of file b_e_object.php.

BEObject::objectId ( val  ) 

Get object id from an identifier that could be an id or nickname.

Parameters:
mixed $val

Definition at line 783 of file b_e_object.php.

References getIdFromNickname().

BEObject::updateTitleDescription ( id,
title,
description 
)

Update title and description only.

Parameters:
int $id
string|null $title
string|null $description
Returns:
bool

Definition at line 620 of file b_e_object.php.

Referenced by afterSave().


Member Data Documentation

BEObject::$belongsTo
Initial value:
 array(
        'ObjectType' =>
            array(
                'className'     => 'ObjectType',
                'foreignKey'    => 'object_type_id',
                'conditions'    => ''
            ),
        'UserCreated' =>
            array(
                'className'     => 'User',
                'fields'        => 'id, userid, realname',
                'foreignKey'    => 'user_created',
            ),
        'UserModified' =>
            array(
                'className'     => 'User',
                'fields'        => 'id, userid, realname',
                'foreignKey'    => 'user_modified',
            ),
    )

Definition at line 56 of file b_e_object.php.

BEObject::$hasAndBelongsToMany
Initial value:
 array(
        'Category' =>
            array(
                'className'             => 'Category',
                'joinTable'             => 'object_categories',
                'foreignKey'            => 'object_id',
                'associationForeignKey' => 'category_id',
                'unique'                => true
            ),
        'User' =>
               array(
                'className'             => 'User',
                'joinTable'             => 'object_users',
                'foreignKey'            => 'object_id',
                'associationForeignKey' => 'user_id',
                'unique'                => true,
                'with'                  => 'ObjectUser'
               )
    )

Definition at line 126 of file b_e_object.php.

BEObject::$validate
Initial value:
 array(



        'object_type_id' => array(
            'rule' => 'notEmpty'
        ),
        'nickname' => array(
            'rule' => 'notEmpty'
        ),
        'lang' => array(
            'rule' => 'notEmpty'
        ),
        'ip_created' => array(
            'rule' => 'ip'
        ),
        'status' => array(
            'rule' => array('inList', array('on', 'off', 'draft'))
        ),
    )

Definition at line 35 of file b_e_object.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