Class humhub\modules\post\models\Post

Inheritancehumhub\modules\post\models\Post » humhub\modules\content\components\ContentActiveRecord » humhub\components\ActiveRecord » yii\db\ActiveRecord
ImplementsSerializable, humhub\modules\content\interfaces\ContentOwner, humhub\modules\content\models\Movable, humhub\modules\search\interfaces\Searchable

This is the model class for table "post".

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$autoFollow boolean Should the originator automatically follows this content when saved. humhub\modules\content\components\ContentActiveRecord
$canMove boolean Defines if the Movable behaviour of this ContentContainerActiveRecord type is active. humhub\modules\post\models\Post
$moduleId string Related moduleId humhub\modules\post\models\Post
$silentContentCreation boolean humhub\modules\content\components\ContentActiveRecord
$wallEntryClass string The WallEntry widget class humhub\modules\post\models\Post

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$initContent humhub\modules\content\models\Content Used to cache the content relation in order to avoid the relation to be overwritten in the insert process humhub\modules\content\components\ContentActiveRecord
$managePermission string Permission instance humhub\modules\content\components\ContentActiveRecord
$streamChannel string|null The stream channel humhub\modules\content\components\ContentActiveRecord

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() ContentActiveRecord constructor accepts either an configuration array as first argument or an ContentContainerActiveRecord and visibility settings. humhub\modules\content\components\ContentActiveRecord
__get() humhub\modules\content\components\ContentActiveRecord
afterDelete() humhub\modules\content\components\ContentActiveRecord
afterMove() This function can be overwritten in order to define model specific logic as moving sub-content or other related humhub\modules\content\components\ContentActiveRecord
afterSave() humhub\modules\post\models\Post
beforeSave() humhub\modules\post\models\Post
canMove() Can be overwritten to define additional model specific checks. humhub\modules\content\components\ContentActiveRecord
find() Returns an ActiveQueryContent to find content. humhub\modules\content\components\ContentActiveRecord
getContent() Related Content model humhub\modules\content\components\ContentActiveRecord
getContentDescription() Returns a description of this particular content. humhub\modules\post\models\Post
getContentName() Returns the name of this type of content. humhub\modules\post\models\Post
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
getIcon() Can be used to define an icon for this content type e.g.: 'fa-calendar'. humhub\modules\post\models\Post
getLabels() Returns either Label widget instances or strings. humhub\modules\post\models\Post
getManagePermission() Returns the $managePermission settings interpretable by an PermissionManager instance. humhub\modules\content\components\ContentActiveRecord
getModuleId() Returns the id of the module related to this content type Note: This may not be implemented by some legacy modules humhub\modules\content\components\ContentActiveRecord
getObjectModel() humhub\modules\content\components\ContentActiveRecord
getOwner() humhub\modules\content\components\ContentActiveRecord
getSearchAttributes() humhub\modules\post\models\Post
getUniqueId() Returns a unique id for this record/model humhub\components\ActiveRecord
getUpdatedBy() Relation to User defined in updated_by attribute humhub\components\ActiveRecord
getWallEntryWidget() Returns an instance of the assigned wall entry widget instance. This can be used to check matadata fields of the related widget. humhub\modules\content\components\ContentActiveRecord
getWallOut() Returns the wall output widget of this content. humhub\modules\content\components\ContentActiveRecord
hasManagePermission() Determines weather or not this records has an additional managePermission set. humhub\modules\content\components\ContentActiveRecord
init() humhub\modules\content\components\ContentActiveRecord
isOwner() Checks if the given user or the current logged in user if no user was given, is the owner of this content humhub\modules\content\components\ContentActiveRecord
move() {@inheritdoc} humhub\modules\content\components\ContentActiveRecord
rules() humhub\modules\post\models\Post
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
tableName() humhub\modules\post\models\Post
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord

Property Details

$canMove public property

Defines if the Movable behaviour of this ContentContainerActiveRecord type is active.

public boolean $canMove true
$moduleId public property

Related moduleId

public string $moduleId 'post'
$wallEntryClass public property

The WallEntry widget class

public string $wallEntryClass 'humhub\modules\post\widgets\WallEntry'

Method Details

afterSave() public method

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

public void beforeSave ( $insert )
$insert
getContentDescription() public method

Returns a description of this particular content.

This will be used to create a text preview of the content record. (e.g. in Activities or Notifications) You need to override this method in your content implementation.

public string getContentDescription ( )
return string

Description of this content

getContentName() public method

Returns the name of this type of content.

You need to override this method in your content implementation.

public string getContentName ( )
return string

The name of the content

getIcon() public method

Can be used to define an icon for this content type e.g.: 'fa-calendar'.

public string getIcon ( )
getLabels() public method

Returns either Label widget instances or strings.

Subclasses should call paren::getLabels() as follows:

public function getLabels($labels = [], $includeContentName = true)
{
   return parent::getLabels([Label::info('someText')->sortOrder(5)]);
}
public humhub\widgets\Label[]|\string[] getLabels ( $result = [], $includeContentName true )
$result
$includeContentName boolean
return humhub\widgets\Label[]|\string[]

Content labels used for example in wallentrywidget

getSearchAttributes() public method

public void getSearchAttributes ( )
rules() public method

public void rules ( )
tableName() public static method

public static void tableName ( )