$name
$name : string
Name of the group
The variable is considered to be read-only.
MidCOM group implementation supporting Midgard Groups.
$scope : integer
The scope value, which must be set during the _load callback, indicates the "depth" of the group in the inheritance tree. This is used during privilege merging in the content privilege code, which needs a way to determine the proper ordering. Top level groups start with a scope of 1.
The variable is considered to be read-only.
$_storage : \midgard_group
The storage object on which we are based. This is usually a midgard_group directly, as this class has to work outside of the ACLs. It must not be used from the outside.
Access to this member is restricted to the ACL user/group core. In case you need a real Storage object for this group, call get_storage() instead.
$_cached_parent_group : \midcom_core_group
Contains the parent of the current group, cached for repeated accesses.
__construct(mixed $id = null)
The constructor retrieves the group identified by its name from the database and prepares the object for operation.
It will use the Query Builder to retrieve a group by its name and populate the $storage, $name and $id members accordingly.
Any error will trigger midcom_error.
mixed | $id | This is a valid identifier for the group to be loaded. Usually this is either a database ID or GUID for Midgard Groups or a valid complete MidCOM group identifier, which will work for all subclasses. |
list_members() : array<mixed,\midcom_core_user>
Retrieves a list of users for which are a member in this group.
A list of user objects in which are members of the current group, indexed by their ID.
list_memberships(\midcom_core_user $user) : array<mixed,\midcom_core_group>
Return a list of all groups in which the MidCOM user passed is a member.
\midcom_core_user | $user | The user that should be looked up. |
Member groups, indexed by their ID.
get_parent_group() : \midcom_core_group
Returns the parent group.
The parent group of the current group or null if there is none.
get_privileges() : array<mixed,\midcom_core_privilege>
Return a list of privileges assigned directly to the group. The default implementation queries the GUID directly using the get_self_privileges method of the midcom_core_privilege class, which should work fine on all MgdSchema objects. If the storage object is null, an empty array is returned.
get_storage() : \midcom_db_group
Return a MidCOM DBA level storage object for the current group. Be aware, that depending on ACL information, the retrieval of the user may fail.
Also, as outlined in the member $_storage, not all groups may have a DBA object associated with them, therefore this call may return null.
The default implementation will return an instance of midcom_db_group based on the member $this->_storage->id if that object is defined, or null otherwise.
A MidCOM DBA object that holds the information associated with this group, or null if there is no storage object.
Loading…