Class humhub\modules\like\models\Like

Inheritancehumhub\modules\like\models\Like » humhub\modules\content\components\ContentAddonActiveRecord » humhub\components\ActiveRecord » yii\db\ActiveRecord
ImplementsSerializable, humhub\modules\content\interfaces\ContentOwner
Available since version0.5

This is the model class for table "like".

The followings are the available columns in table 'like':

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$automaticContentFollowing boolean Automatic following of the addon creator to the related content humhub\modules\content\components\ContentAddonActiveRecord
$updateContentStreamSort boolean Also update underlying contents last update stream sorting humhub\modules\like\models\Like

Public Methods

Hide inherited methods

MethodDescriptionDefined By
GetLikes() Like Count for specifc model humhub\modules\like\models\Like
afterSave() After Save, delete LikeCount (Cache) for target object humhub\modules\like\models\Like
beforeDelete() Before Delete, remove LikeCount (Cache) of target object. humhub\modules\like\models\Like
beforeSave() humhub\components\ActiveRecord
behaviors() humhub\modules\like\models\Like
canDelete() Checks if the given / or current user can delete this content. humhub\modules\content\components\ContentAddonActiveRecord
canRead() Check if current user can read this object humhub\modules\content\components\ContentAddonActiveRecord
canWrite() Checks if this content addon can be changed humhub\modules\content\components\ContentAddonActiveRecord
getContent() Returns the content object to which this addon belongs to. humhub\modules\content\components\ContentAddonActiveRecord
getContentDescription() Returns a text preview of this content. humhub\modules\content\components\ContentAddonActiveRecord
getContentName() Returns a title for this type of content. humhub\modules\content\components\ContentAddonActiveRecord
getCreatedBy() Relation to User defined in created_by attribute humhub\components\ActiveRecord
getErrorMessage() Returns the errors as string for all attribute or a single attribute. humhub\components\ActiveRecord
getFileManager() Returns the file manager for this record humhub\components\ActiveRecord
getSource() Returns the source of this content addon. humhub\modules\content\components\ContentAddonActiveRecord
getUniqueId() Returns a unique id for this record/model humhub\components\ActiveRecord
getUpdatedBy() Relation to User defined in updated_by attribute humhub\components\ActiveRecord
getUser() humhub\modules\content\components\ContentAddonActiveRecord
rules() humhub\modules\like\models\Like
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
tableName() humhub\modules\like\models\Like
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord
validate() Validates humhub\modules\content\components\ContentAddonActiveRecord

Property Details

$updateContentStreamSort protected property

Also update underlying contents last update stream sorting

Method Details

GetLikes() public static method

Like Count for specifc model

public static void GetLikes ( $objectModel, $objectId )
$objectModel
$objectId
afterSave() public method

After Save, delete LikeCount (Cache) for target object

public void afterSave ( $insert, $changedAttributes )
$insert
$changedAttributes
beforeDelete() public method

Before Delete, remove LikeCount (Cache) of target object.

Remove activity

public void beforeDelete ( )
behaviors() public method

public void behaviors ( )
rules() public method

public array rules ( )
return array

Validation rules for model attributes.

tableName() public static method

public static string tableName ( )
return string

The associated database table name