Nos\Comments\
Orm_Behaviour_Commentable
¶Adds the ability to use the Comment API on an a Nos\Orm\Model
.
Nos\Comments\Orm_Behaviour_Commentable::
commentApi
¶Returns: | An instance of Nos\Comments\Api` , configured for this item. |
---|
Nos\Comments\Orm_Behaviour_Commentable::
count_comments
()¶Returns and caches the number of comments related to one item
Returns: | Number of comments |
---|
Nos\Comments\Orm_Behaviour_Commentable::
setNbComments
($nb)¶Allow to enter a custom cached number of comments related to the item. Can be useful when adding or removing a comment for instance.
Parameters: |
|
---|
Nos\Comments\Orm_Behaviour_Commentable::
count_multiple_comments
($items)¶From a items’ list, retrieve the number of comments in an optimal way.
Parameters: |
|
---|
This behaviour adds a comments relation to retrieve all the published comments of the Model.
<?php
class Model_Monkey extends \Nos\Orm\Model
{
protected static $_behaviours = array(
'Nos\Comments\Orm_Behaviour_Commentable' => array(
),
);
}