Abstract Class humhub\modules\content\components\ContentContainerActiveRecord
ContentContainerActiveRecord for ContentContainer Models e.g. Space or User.
Required Methods:
- getProfileImage()
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$controllerBehavior | string | Class name of additional the controller behavior | humhub\modules\content\components\ContentContainerActiveRecord |
$defaultRoute | string | The default route | humhub\modules\content\components\ContentContainerActiveRecord |
Protected Properties
Public Methods
Property Details
Class name of additional the controller behavior
See also humhub\modules\content\components\ContentContainerController.
The default route
Method Details
public void afterDelete ( ) |
public void afterSave ( $insert, $changedAttributes ) | ||
$insert | ||
$changedAttributes |
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 |
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 |
---|
Creates url in content container scope.
public void createUrl ( $route = null, $params = [], $scheme = false ) | ||
$route | string | |
$params | array | |
$scheme | boolean|string |
public static humhub\modules\content\components\ContentContainerActiveRecord|null findByGuid ( $token ) | ||
$token |
Returns the related ContentContainer model (e.g. Space or User)
public humhub\modules\content\models\ContentContainer getContentContainerRecord ( ) |
Determines the default visibility of this container type.
public integer getDefaultContentVisibility ( ) |
Returns the display name of content container
public abstract string getDisplayName ( ) |
Returns a descriptive sub title of this container used in the frontend.
public abstract mixed getDisplayNameSub ( ) |
Returns a ModuleManager
public \humhub\modules\content\components\ModuleManager getModuleManager ( ) |
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 |
Returns the Profile Banner Image Object for this Content Base
public humhub\libs\ProfileBannerImage getProfileBannerImage ( ) |
Returns the Profile Image Object for this Content Base
public humhub\libs\ProfileImage getProfileImage ( ) |
Should be overwritten by implementation
public void getUrl ( ) |
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 |
Returns user groups
public void getUserGroups ( ) |
Returns the wall output for this content container.
This is e.g. used in search results.
public string getWallOut ( ) |
Returns weather or not the contentcontainer is archived. (Default false).
public boolean isArchived ( ) |
Checks the current visibility setting of this ContentContainerActiveRecord
public boolean isVisibleFor ( $visibility ) | ||
$visibility |