Class humhub\modules\content\models\ContentType

Inheritancehumhub\modules\content\models\ContentType » yii\base\Model
Available since version1.3

This class can be used to search for existing types of \humhub\modules\content\components\ContentActiveRecords.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$cache [] Caches the result for contentContainer and global requests [$contentContainer->id|'' => ContentType[]] humhub\modules\content\models\ContentType
$instance humhub\modules\content\components\ContentActiveRecord Instance humhub\modules\content\models\ContentType
$typeClass string humhub\modules\content\models\ContentType

Property Details

$cache public static property

Caches the result for contentContainer and global requests [$contentContainer->id|'' => ContentType[]]

public static [] $cache = []
$instance public property

Instance

$typeClass public property
public string $typeClass null

Method Details

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

getContentTypeSelection() public static method

public static array getContentTypeSelection ( humhub\modules\content\components\ContentContainerActiveRecord $container null )
$container humhub\modules\content\components\ContentContainerActiveRecord|null
return array

Content type selection array in form of [contentTypeClass => contentName]

getContentTypes() public static method

public static static[] getContentTypes ( humhub\modules\content\components\ContentContainerActiveRecord $container null )
$container humhub\modules\content\components\ContentContainerActiveRecord|null
return static[]

Existing content types of the given container

getIcon() public method

public void getIcon ( )
init() public method

public void init ( )