Abstract Class humhub\modules\content\components\ContentContainerActiveRecord

Inheritancehumhub\modules\content\components\ContentContainerActiveRecord » humhub\components\ActiveRecord » yii\db\ActiveRecord
ImplementsSerializable
Subclasseshumhub\modules\admin\models\SpaceSearch, humhub\modules\admin\models\UserApprovalSearch, humhub\modules\admin\models\UserSearch, humhub\modules\admin\models\forms\UserEditForm, humhub\modules\space\models\Space, humhub\modules\space\modules\manage\models\AdvancedSettingsSpace, humhub\modules\user\models\User, humhub\modules\user\models\UserFilter
Available since version1.0

ContentContainerActiveRecord for ContentContainer Models e.g. Space or User.

Required Methods:

 - getProfileImage()

Public Methods

Hide inherited methods

MethodDescriptionDefined By
afterDelete() humhub\modules\content\components\ContentContainerActiveRecord
afterSave() humhub\modules\content\components\ContentContainerActiveRecord
beforeSave() humhub\components\ActiveRecord
can() Checks if the current user has the given Permission on this ContentContainerActiveRecord. humhub\modules\content\components\ContentContainerActiveRecord
canAccessPrivateContent() Checks if the user is allowed to access private content in this container humhub\modules\content\components\ContentContainerActiveRecord
createUrl() Creates url in content container scope. humhub\modules\content\components\ContentContainerActiveRecord
findByGuid() humhub\modules\content\components\ContentContainerActiveRecord
getContentContainerRecord() Returns the related ContentContainer model (e.g. Space or User) humhub\modules\content\components\ContentContainerActiveRecord
getCreatedBy() Relation to User defined in created_by attribute humhub\components\ActiveRecord
getDefaultContentVisibility() Determines the default visibility of this container type. humhub\modules\content\components\ContentContainerActiveRecord
getDisplayName() Returns the display name of content container humhub\modules\content\components\ContentContainerActiveRecord
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
getModuleManager() Returns a ModuleManager humhub\modules\content\components\ContentContainerActiveRecord
getPermissionManager() Returns a ContentContainerPermissionManager instance for this ContentContainerActiveRecord as permission object and the given user (or current user if not given) as permission subject. humhub\modules\content\components\ContentContainerActiveRecord
getProfileBannerImage() Returns the Profile Banner Image Object for this Content Base humhub\modules\content\components\ContentContainerActiveRecord
getProfileImage() Returns the Profile Image Object for this Content Base humhub\modules\content\components\ContentContainerActiveRecord
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() Should be overwritten by implementation humhub\modules\content\components\ContentContainerActiveRecord
getUserGroup() Returns user group for the given $user or current logged in user if no $user instance was provided. humhub\modules\content\components\ContentContainerActiveRecord
getUserGroups() Returns user groups humhub\modules\content\components\ContentContainerActiveRecord
getWallOut() Returns the wall output for this content container. humhub\modules\content\components\ContentContainerActiveRecord
isArchived() Returns weather or not the contentcontainer is archived. (Default false). humhub\modules\content\components\ContentContainerActiveRecord
isVisibleFor() Checks the current visibility setting of this ContentContainerActiveRecord humhub\modules\content\components\ContentContainerActiveRecord
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord

Property Details

$controllerBehavior public property (available since version 1.3)

Class name of additional the controller behavior

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

$defaultRoute public property

The default route

public string $defaultRoute '/'
$moduleManager protected property
$permissionManager protected property

Method Details

afterDelete() public method

public void afterDelete ( )
afterSave() public method

public void afterSave ( $insert, $changedAttributes )
$insert
$changedAttributes
can() public method (available since version 1.2)

Checks if the current user has the given Permission on this ContentContainerActiveRecord.

This is a shortcut for $this->getPermisisonManager()->can().

The following example will check if the current user has MyPermission on the given $contentContainer

$contentContainer->can(MyPermisison::class);

Note: This method is used to verify ContentContainerPermissions and not GroupPermissions.

See also \humhub\modules\content\components\PermissionManager::can().

public boolean can ( $permission, $params = [], $allowCaching true )
$permission string|string[]|humhub\libs\BasePermission
$params
$allowCaching
canAccessPrivateContent() public method

Checks if the user is allowed to access private content in this container

public boolean canAccessPrivateContent ( humhub\modules\user\models\User $user null )
$user humhub\modules\user\models\User
return boolean

Can access private content

createUrl() public method

Creates url in content container scope.

public void createUrl ( $route null, $params = [], $scheme false )
$route string
$params array
$scheme boolean|string
findByGuid() public static method

public static void findByGuid ( $token )
$token
getContentContainerRecord() public method

Returns the related ContentContainer model (e.g. Space or User)

See also humhub\modules\content\models\ContentContainer.

public humhub\modules\content\models\ContentContainer getContentContainerRecord ( )
getDefaultContentVisibility() public method

Determines the default visibility of this container type.

public integer getDefaultContentVisibility ( )
getDisplayName() public method (available since version 0.11.0)

Returns the display name of content container

public string getDisplayName ( )
getModuleManager() public method (available since version 1.3)

Returns a ModuleManager

public \humhub\modules\content\components\ModuleManager getModuleManager ( )
getPermissionManager() public method

Returns a ContentContainerPermissionManager instance for this ContentContainerActiveRecord as permission object and the given user (or current user if not given) as permission subject.

public humhub\modules\content\components\ContentContainerPermissionManager getPermissionManager ( humhub\modules\user\models\User $user null )
$user humhub\modules\user\models\User
getProfileBannerImage() public method

Returns the Profile Banner Image Object for this Content Base

public humhub\libs\ProfileBannerImage getProfileBannerImage ( )
getProfileImage() public method

Returns the Profile Image Object for this Content Base

public humhub\libs\ProfileImage getProfileImage ( )
getUrl() public method

Should be overwritten by implementation

public void getUrl ( )
getUserGroup() public method

Returns user group for the given $user or current logged in user if no $user instance was provided.

public string getUserGroup ( humhub\modules\user\models\User $user null )
$user humhub\modules\user\models\User|null
getUserGroups() public method

Returns user groups

public void getUserGroups ( )
getWallOut() public method

Returns the wall output for this content container.

This is e.g. used in search results.

public string getWallOut ( )
isArchived() public method (available since version 1.2)

Returns weather or not the contentcontainer is archived. (Default false).

public boolean isArchived ( )
isVisibleFor() public method

Checks the current visibility setting of this ContentContainerActiveRecord

public boolean isVisibleFor ( $visibility )
$visibility