Adds the ability to use the Comment API on an a Nos\Orm\Model.
Returns: | An instance of Nos\Comments\Api`, configured for this item. |
---|
Returns and caches the number of comments related to one item
Returns: | Number of comments |
---|
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: |
|
---|
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(
),
);
}