Class humhub\modules\content\activities\ContentCreated

Inheritancehumhub\modules\content\activities\ContentCreated » humhub\modules\activity\components\BaseActivity » humhub\components\SocialActivity » yii\base\BaseObject
ImplementsSerializable, humhub\components\rendering\Viewable, humhub\modules\activity\interfaces\ConfigurableActivityInterface

Activity for created content

See also humhub\modules\content\components\ContentActiveRecord.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
about() Builder function for the source. humhub\components\SocialActivity
asArray() Returns an array representation of this notification. humhub\components\SocialActivity
container() Builder function for setting ContentContainerActiveRecord humhub\modules\activity\components\BaseActivity
create() Creates an activity model and determines the contentContainer/visibility humhub\modules\activity\components\BaseActivity
from() Builder function for the originator. humhub\components\SocialActivity
getContent() Returns the related content instance in case the source is of type ContentOwner. humhub\components\SocialActivity
getContentContainer() Determines if the activity source is related to an ContentContainer. humhub\components\SocialActivity
getContentInfo() Build info text about a content humhub\components\SocialActivity
getContentName() Returns the content name of $content or if not $content is provided of the notification source. humhub\components\SocialActivity
getContentPlainTextInfo() Builds plain text info text about a given content humhub\components\SocialActivity
getContentPlainTextPreview() Returns a short preview text of the content in plain text. The max length can be defined by setting $maxLength (25 by default). humhub\components\SocialActivity
getContentPreview() Returns a short preview text of the content. The max length can be defined by setting $maxLength (25 by default). humhub\components\SocialActivity
getDescription() Returns the description of the activity, which is displayed on the configuration page. humhub\modules\content\activities\ContentCreated
getSpace() humhub\components\SocialActivity
getSpaceId() humhub\components\SocialActivity
getTitle() Returns the title of the activity, which is displayed on the configuration page. humhub\modules\content\activities\ContentCreated
getUrl() Url of the origin of this notification If source is a Content / ContentAddon / ContentContainer this will automatically generated. humhub\components\SocialActivity
getViewName() humhub\components\SocialActivity
getViewParams() Returns an array of view parameter, required for rendering. humhub\components\SocialActivity
hasContent() Determines if this activity is related to a content. This is the case if the activitiy source is of type ContentOwner. humhub\components\SocialActivity
html() humhub\components\SocialActivity
init() humhub\components\SocialActivity
instance() Static initializer should be prefered over new initialization, since it makes use of Yii::createObject dependency injection/configuration. humhub\components\SocialActivity
json() humhub\components\SocialActivity
save() Stores the activity in database humhub\modules\activity\components\BaseActivity
serialize() Serializes the $source and $originator fields. humhub\components\SocialActivity
text() humhub\components\SocialActivity
unserialize() Unserializes the given string, calls the init() function and sets the $source and $originator fields (and $record indirectyl). humhub\components\SocialActivity
validate() Validates the existence of required attributes humhub\components\SocialActivity

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getContentVisibility() Returns the visibility of the content humhub\modules\activity\components\BaseActivity
getOriginatorId() Returns the user id of the originator of this activity humhub\modules\activity\components\BaseActivity

Property Details

$moduleId public property

The module id which this activity belongs to (required)

public string $moduleId 'content'
$viewName public property

View name used for rendering the activity

public string $viewName 'created'

Method Details

getDescription() public method

Returns the description of the activity, which is displayed on the configuration page.

public string getDescription ( )
return string

The description of the activity

getTitle() public method

Returns the title of the activity, which is displayed on the configuration page.

public string getTitle ( )
return string

The title of the activity