Class humhub\modules\space\models\Space

Inheritancehumhub\modules\space\models\Space » humhub\modules\content\components\ContentContainerActiveRecord » humhub\components\ActiveRecord » yii\db\ActiveRecord
ImplementsSerializable, humhub\modules\search\interfaces\Searchable
Subclasseshumhub\modules\admin\models\SpaceSearch, humhub\modules\space\modules\manage\models\AdvancedSettingsSpace

This is the model class for table "space".

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$controllerBehavior string Class name of additional the controller behavior humhub\modules\space\models\Space
$defaultRoute string The default route humhub\modules\space\models\Space

Public Methods

Hide inherited methods

MethodDescriptionDefined By
afterDelete() humhub\modules\content\components\ContentContainerActiveRecord
afterSave() humhub\modules\space\models\Space
archive() Archive this Space humhub\modules\space\models\Space
attributeHints() humhub\modules\space\models\Space
attributeLabels() humhub\modules\space\models\Space
beforeDelete() humhub\modules\space\models\Space
beforeSave() humhub\modules\space\models\Space
behaviors() humhub\modules\space\models\Space
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\space\models\Space
canInvite() Checks if given user can invite people to this workspace Note: use directly permission instead humhub\modules\space\models\Space
canJoin() Indicates that this user can join this workspace humhub\modules\space\models\Space
canJoinFree() Indicates that this user can join this workspace w ithout permission humhub\modules\space\models\Space
canShare() Checks if given user can share content. humhub\modules\space\models\Space
checkVisibility() Validator for visibility humhub\modules\space\models\Space
createUrl() Creates url in content container scope. humhub\modules\content\components\ContentContainerActiveRecord
findByGuid() humhub\modules\content\components\ContentContainerActiveRecord
getApplicants() humhub\modules\space\models\Space
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() Returns the default content visibility humhub\modules\space\models\Space
getDisplayName() Returns display name (title) of space humhub\modules\space\models\Space
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
getMembershipUser() humhub\modules\space\models\Space
getMemberships() Returns all Membership relations with status = STATUS_MEMBER. humhub\modules\space\models\Space
getModuleManager() Returns a ModuleManager humhub\modules\content\components\ContentContainerActiveRecord
getNonMembershipUser() humhub\modules\space\models\Space
getOwnerUser() humhub\modules\space\models\Space
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
getSearchAttributes() Returns an array of informations used by search subsystem. humhub\modules\space\models\Space
getTags() Returns an array with assigned Tags humhub\modules\space\models\Space
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\space\models\Space
getUserGroups() Return user groups humhub\modules\space\models\Space
getWallOut() Returns the wall output for this content container. humhub\modules\space\models\Space
hasTags() Checks if space has tags humhub\modules\space\models\Space
isArchived() Returns wether or not a Space is archived. humhub\modules\space\models\Space
isVisibleFor() Checks the current visibility setting of this ContentContainerActiveRecord humhub\modules\content\components\ContentContainerActiveRecord
rules() humhub\modules\space\models\Space
scenarios() humhub\modules\space\models\Space
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
tableName() humhub\modules\space\models\Space
unarchive() Unarchive this Space humhub\modules\space\models\Space
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
JOIN_POLICY_APPLICATION 1 humhub\modules\space\models\Space
JOIN_POLICY_FREE 2 humhub\modules\space\models\Space
JOIN_POLICY_NONE 0 humhub\modules\space\models\Space
SCENARIO_CREATE 'create' humhub\modules\space\models\Space
SCENARIO_EDIT 'edit' humhub\modules\space\models\Space
STATUS_ARCHIVED 2 humhub\modules\space\models\Space
STATUS_DISABLED 0 humhub\modules\space\models\Space
STATUS_ENABLED 1 humhub\modules\space\models\Space
USERGROUP_ADMIN 'admin' humhub\modules\space\models\Space
USERGROUP_GUEST 'guest' humhub\modules\space\models\Space
USERGROUP_MEMBER 'member' humhub\modules\space\models\Space
USERGROUP_MODERATOR 'moderator' humhub\modules\space\models\Space
USERGROUP_OWNER 'owner' humhub\modules\space\models\Space
USERGROUP_USER 'user' humhub\modules\space\models\Space
VISIBILITY_ALL 2 humhub\modules\space\models\Space
VISIBILITY_NONE 0 humhub\modules\space\models\Space
VISIBILITY_REGISTERED_ONLY 1 humhub\modules\space\models\Space

Property Details

$controllerBehavior public property

Class name of additional the controller behavior

public string $controllerBehavior = \humhub\modules\space\behaviors\SpaceController::class
$defaultRoute public property

The default route

public string $defaultRoute '/space/space'

Method Details

afterSave() public method

public void afterSave ( $insert, $changedAttributes )
$insert
$changedAttributes
archive() public method

Archive this Space

public void archive ( )
attributeHints() public method

public void attributeHints ( )
attributeLabels() public method

public void attributeLabels ( )
beforeDelete() public method

public void beforeDelete ( )
beforeSave() public method

public void beforeSave ( $insert )
$insert
behaviors() public method

public void behaviors ( )
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

canInvite() public method
Deprecated since version 1.1

Checks if given user can invite people to this workspace Note: use directly permission instead

public boolean canInvite ( )
canJoin() public method

Indicates that this user can join this workspace

public void canJoin ( $userId '' )
$userId

User Id of User

canJoinFree() public method

Indicates that this user can join this workspace w ithout permission

public void canJoinFree ( $userId '' )
$userId

User Id of User

canShare() public method
Deprecated since version 1.1

Checks if given user can share content.

Shared Content is public and is visible also for non members of the space. Note: use directly permission instead

public boolean canShare ( )
checkVisibility() public method

Validator for visibility

Used in edit scenario to check if the user really can create spaces on this visibility.

public void checkVisibility ( $attribute, $params )
$attribute \humhub\modules\space\models\type
$params \humhub\modules\space\models\type
getApplicants() public method

public void getApplicants ( )
getDefaultContentVisibility() public method

Returns the default content visibility

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

public integer getDefaultContentVisibility ( )
return integer

The default visiblity

getDisplayName() public method (available since version 0.11.0)

Returns display name (title) of space

public string getDisplayName ( )
getMembershipUser() public method

public void getMembershipUser ( $status null )
$status
getMemberships() public method

Returns all Membership relations with status = STATUS_MEMBER.

Be aware that this function will also include disabled users, in order to only include active and visible users use:

Membership::getSpaceMembersQuery($this->space)->active()->visible()->count()
public \yii\db\ActiveQuery getMemberships ( )
getNonMembershipUser() public method

public void getNonMembershipUser ( )
getOwnerUser() public method

public \yii\db\ActiveQuery getOwnerUser ( )
getSearchAttributes() public method

Returns an array of informations used by search subsystem.

Function is defined in interface ISearchable

public Array getSearchAttributes ( )
getTags() public method

Returns an array with assigned Tags

public void getTags ( )
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

Return user groups

public array getUserGroups ( )
return array

User groups

getWallOut() public method

Returns the wall output for this content container.

This is e.g. used in search results.

public string getWallOut ( )
hasTags() public method

Checks if space has tags

public boolean hasTags ( )
return boolean

Has tags set

isArchived() public method (available since version 1.2)

Returns wether or not a Space is archived.

public boolean isArchived ( )
rules() public method

public void rules ( )
scenarios() public method

public void scenarios ( )
tableName() public static method

public static void tableName ( )
unarchive() public method

Unarchive this Space

public void unarchive ( )