Class humhub\modules\content\components\ActiveQueryContent

Inheritancehumhub\modules\content\components\ActiveQueryContent » yii\db\ActiveQuery

ActiveQueryContent is an enhanced ActiveQuery with additional selectors for especially content.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
contentContainer() Limits the returned records to the given ContentContainer. humhub\modules\content\components\ActiveQueryContent
contentTag() Returns only content which has one or all of given ContentTags humhub\modules\content\components\ActiveQueryContent
readable() Only returns user readable records humhub\modules\content\components\ActiveQueryContent
userRelated() Finds user related content. humhub\modules\content\components\ActiveQueryContent
where() Adds an additional WHERE condition to the existing one. humhub\modules\content\components\ActiveQueryContent

Constants

Hide inherited constants

ConstantValueDescriptionDefined By

Method Details

contentContainer() public method

Limits the returned records to the given ContentContainer.

public humhub\modules\content\components\ActiveQueryContent contentContainer ( $container )
$container humhub\modules\content\components\ContentContainerActiveRecord

|null or null for global content

throws \yii\base\Exception
contentTag() public method

Returns only content which has one or all of given ContentTags

public humhub\modules\content\components\ActiveQueryContent contentTag ( $contentTags, $mode 'AND' )
$contentTags

ContentTag[]|ContentTag

$mode

String

readable() public method

Only returns user readable records

public humhub\modules\content\components\ActiveQueryContent readable ( $user null )
$user humhub\modules\user\models\User
throws Throwable
userRelated() public method

Finds user related content.

All available scopes: ActiveQueryContent::USER_RELATEDSCOPE*

public humhub\modules\content\components\ActiveQueryContent userRelated ( $scopes = [], $user null )
$scopes array
$user humhub\modules\user\models\User
where() public method

Adds an additional WHERE condition to the existing one.

public $this where ( $condition, $params = [] )
$condition array|string
$params array