Class humhub\modules\topic\models\Topic

Inheritancehumhub\modules\topic\models\Topic » humhub\modules\content\models\ContentTag » humhub\components\ActiveRecord » yii\db\ActiveRecord
Available since version1.3

ContentTag type used for categorizing content.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$additionClass string Class of ContentTagAddition (optional), if set a call to $tag->addition will create an empty addition instance, the addition will also be validated and saved in the tag save process. humhub\modules\content\models\ContentTag
$includeTypeQuery boolean If set to true the default search queries will include a type condition beside the module condition, this is only required if one module provides multiple content tag concepts. humhub\modules\content\models\ContentTag
$moduleId string Id of the module related to this content tag concept humhub\modules\topic\models\Topic

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() ContentTag constructor. humhub\modules\content\models\ContentTag
__get() humhub\modules\content\models\ContentTag
addQueryCondition() Adds content tag related fitler conditions to a given query. humhub\modules\content\models\ContentTag
afterSave() humhub\modules\content\models\ContentTag
attach() Attaches the given topics to the given content instance. humhub\modules\topic\models\Topic
attributeLabels() humhub\modules\topic\models\Topic
beforeSave() humhub\components\ActiveRecord
deleteAll() In case this function is not called on the base ContentTag function, it will ensure to that at least either a 'module_id' or 'type' condition is given to prevent deleting all content tags. humhub\modules\content\models\ContentTag
deleteByModule() Deletes all tags by module id humhub\modules\content\models\ContentTag
deleteByType() Deletes all tags by type humhub\modules\content\models\ContentTag
deleteContentRelations() Deletes all tag relations of the given type for the given $content. humhub\modules\content\models\ContentTag
find() Finds instances and filters by module_id if a static module_id is given. humhub\modules\content\models\ContentTag
findAll() Searches for all content tags of this type. humhub\modules\content\models\ContentTag
findByContainer() Finds instances by ContentContainerActiveRecord and optional type. humhub\modules\content\models\ContentTag
findByContent() Returns Content related tags. humhub\modules\content\models\ContentTag
findByModule() Finds ContentTag for the given $moduleId humhub\modules\content\models\ContentTag
findByName() Finds instances by given name and optionally by contentContainer. humhub\modules\content\models\ContentTag
findByType() Finds instances by given $type. humhub\modules\content\models\ContentTag
findGlobal() Finds all global content tags of this type. humhub\modules\content\models\ContentTag
findOne() Find a single instances either by providing an id or other condition. humhub\modules\content\models\ContentTag
getAddition() humhub\modules\content\models\ContentTag
getContainer() Returns the actual Container (Space/User) related to this tag or null if this is a global tag. humhub\modules\content\models\ContentTag
getContentContainer() Returns the ContentContainer relation as ActiveQuery to this tag or null if this is a global tag. humhub\modules\content\models\ContentTag
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() humhub\modules\topic\models\Topic
getLabel() humhub\modules\topic\models\Topic
getParent() Returns the parent tag relation. humhub\modules\content\models\ContentTag
getTagContentRelations() Returns all tag relations of the given type for the given $content. humhub\modules\content\models\ContentTag
getUniqueId() Returns a unique id for this record/model humhub\components\ActiveRecord
getUpdatedBy() Relation to User defined in updated_by attribute humhub\components\ActiveRecord
getUrl() humhub\modules\topic\models\Topic
hasAddition() humhub\modules\content\models\ContentTag
init() Sets the module_id as and type. humhub\modules\content\models\ContentTag
is() Checks if this content tag is of the given $type. humhub\modules\content\models\ContentTag
load() humhub\modules\content\models\ContentTag
moduleQuery() Adds an module id filter query to the given $query instance in case a subclass has set the $moduleId. humhub\modules\content\models\ContentTag
rules() humhub\modules\content\models\ContentTag
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
setAddition() Sets a ContentTagAddition for this instance, note you'll have to call $tag->save() manually humhub\modules\content\models\ContentTag
tableName() humhub\modules\content\models\ContentTag
typeQuery() Adds an type filter query to the given $query instance in case $includeTypeQuery of the subclass is set to true and the calling class is not ContentTag class itself. humhub\modules\content\models\ContentTag
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord
validate() humhub\modules\content\models\ContentTag
validateUnique() Validates humhub\modules\content\models\ContentTag

Property Details

$moduleId public property

Id of the module related to this content tag concept

public string $moduleId 'topic'

Method Details

attach() public static method

Attaches the given topics to the given content instance.

public static void attach ( humhub\modules\content\interfaces\ContentOwner $contentOwner, $topics )
$topics integer[]|integer|humhub\modules\topic\models\Topic|humhub\modules\topic\models\Topic[]

Either a single or array of topics or topic Ids to add.

attributeLabels() public method

public void attributeLabels ( )
getIcon() public static method

public static string getIcon ( )
return string

Topic icon used in badges etc.

getLabel() public static method

public static void getLabel ( )
getUrl() public method

public string getUrl ( )
return string

Link to topic filter stream page