Group Class Reference

Inheritance diagram for Group:
Permitable Item CustomFieldsModel RedBeanModel BeanModel ObservableComponent

Public Member Functions

 canGivePermissions ()
 canModifyMemberships ()
 canModifyName ()
 canModifyRights ()
 canModifyPolicies ()
 isDeletable ()
 contains (Permitable $permitable)
 __toString ()
 __get ($attributeName)
 __set ($attributeName, $value)
 getEffectiveRight ($moduleName, $rightName)
 getActualRight ($moduleName, $rightName)
 getPropagatedActualAllowRight ($moduleName, $rightName)
 getInheritedActualRight ($moduleName, $rightName)
 getInheritedActualPolicy ($moduleName, $policyName)
 getInheritedActualPolicyIgnoringEveryone ($moduleName, $policyName)
 isNameNotAReservedName ($name)

Static Public Member Functions

static getByName ($name)
static getById ($id, $modelClassName=null)
static isUserASuperAdministrator (User $user)
static mangleTableName ()
static getDefaultMetadata ()
static isTypeDeletable ()
static getModuleClassName ()

Data Fields

const EVERYONE_GROUP_NAME = 'Everyone'
const SUPER_ADMINISTRATORS_GROUP_NAME = 'Super Administrators'

Protected Member Functions

 constructDerived ($bean, $setDefaults)
 setSpecialGroup ()
 getInheritedActualRightIgnoringEveryone ($moduleName, $rightName)
 afterSave ()
 beforeSave ()
 beforeDelete ()
 afterDelete ()

Static Protected Member Functions

static translatedAttributeLabels ($language)

Protected Attributes

 $isEveryone = false
 $isSuperAdministrators = false

Detailed Description

Definition at line 37 of file Group.php.


Member Function Documentation

static getByName ( name  )  [static]
Parameters:
string $name
Returns:
An|Group
Exceptions:
NotFoundException 

Reimplemented from Item.

Definition at line 57 of file Group.php.

static getById ( id,
modelClassName = null 
) [static]

Gets a model from the database by Id.

Parameters:
$id Integer Id.
$modelClassName Pass only when getting it at runtime gets the wrong name.
Returns:
A model of the type of the extending model.

Reimplemented from RedBeanModel.

Definition at line 81 of file Group.php.

constructDerived ( bean,
setDefaults 
) [protected]
Parameters:
RedBean_OODBBean $bean
bool $setDefaults

Reimplemented from CustomFieldsModel.

Definition at line 109 of file Group.php.

isDeletable (  ) 

To be overridden by derived classes to prevent deletion.

Reimplemented from RedBeanModel.

Definition at line 153 of file Group.php.

__toString (  ) 

Returns the displayable string for the class. Should be overridden in any model that can provide a meaningful string representation of itself.

Returns:
A string.

Reimplemented from RedBeanModel.

Definition at line 189 of file Group.php.

static mangleTableName (  )  [static]

By default the table name is the lowercased class name. If this conflicts with a database keyword override to return true. RedBean does not quote table names in most cases.

Reimplemented from RedBeanModel.

Definition at line 207 of file Group.php.

__get ( attributeName  ) 

Exposes the members and relations of the model as if they were actual attributes of the model. See __set().

Parameters:
$attributeName A non-empty string that is the name of a member or relation.
See also:
attributeNames()
Returns:
A value or model of the type specified as valid for the member or relation by the meta data supplied by the extending class's getMetadata() method.

Reimplemented from RedBeanModel.

Definition at line 222 of file Group.php.

__set ( attributeName,
value 
)

Sets the members and relations of the model as if they were actual attributes of the model. For example, if Account extends RedBeanModel and its attributeNames() returns that one it has a member 'name' and a relation 'owner' they are simply accessed as:

   $account = new Account();
   $account->name = 'International Corp';
   $account->owner = User::getByUsername('bill');
   $account->save();
Parameters:
$attributeName A non-empty string that is the name of a member or relation of the model.
$value A value or model of the type specified as valid for the member or relation by the meta data supplied by the extending class's getMetadata() method.

Reimplemented from Item.

Definition at line 245 of file Group.php.

getEffectiveRight ( moduleName,
rightName 
)
Parameters:
string $moduleName
string $rightName
Returns:
mixed

Reimplemented from Permitable.

Definition at line 259 of file Group.php.

getActualRight ( moduleName,
rightName 
)
Parameters:
string $moduleName
string $rightName
Returns:
int

Reimplemented from Permitable.

Definition at line 269 of file Group.php.

getInheritedActualRight ( moduleName,
rightName 
)
Parameters:
string $moduleName
string $rightName
Returns:
int

Reimplemented from Permitable.

Definition at line 303 of file Group.php.

getInheritedActualRightIgnoringEveryone ( moduleName,
rightName 
) [protected]
Parameters:
string $moduleName
string $rightName
Returns:
int|void
Exceptions:
NotSupportedException 

Reimplemented from Permitable.

Definition at line 333 of file Group.php.

getInheritedActualPolicy ( moduleName,
policyName 
)
Parameters:
string $moduleName
string $policyName
Returns:
mixed|null|string

Reimplemented from Permitable.

Definition at line 370 of file Group.php.

getInheritedActualPolicyIgnoringEveryone ( moduleName,
policyName 
)
Parameters:
string $moduleName
string $policyName
Returns:
null

Definition at line 388 of file Group.php.

static getDefaultMetadata (  )  [static]

Returns the default meta data for the class. It must be appended to the meta data from the parent model, if any.

Reimplemented from Permitable.

Definition at line 410 of file Group.php.

static isTypeDeletable (  )  [static]

To be overriden on intermediate derived classes to return false so that deletes are not done on intermediate classes because the object relational mapping will not clean up properly. For example if User is a Person, and Person is a RedBeanModel delete should be called only on User, not on Person. So User must override isDeletable to return false.

Reimplemented from Permitable.

Definition at line 433 of file Group.php.

isNameNotAReservedName ( name  ) 

Used to validate if the group name is a reserved word.

Returns:
boolean, true if valid. false if not.

Definition at line 442 of file Group.php.

beforeSave (  )  [protected]

Special handling of the import scenario. When you are importing a model, you can potentially set the created/modified user/datetime which is normally not allowed since they are read-only attributes. This logic helps to allow for this special use case.

See also:
RedBeanModel::beforeSave()

Reimplemented from Item.

Definition at line 473 of file Group.php.

beforeDelete (  )  [protected]

This method is invoked before deleting a record. The default implementation raises the onBeforeDelete event. You may override this method to do any preparation work for record deletion. Make sure you call the parent implementation so that the event is raised properly.

Returns:
boolean whether the record should be deleted. Defaults to true.

Reimplemented from RedBeanModel.

Definition at line 495 of file Group.php.

afterDelete (  )  [protected]

This method is invoked after deleting a record. The default implementation raises the onAfterDelete event. You may override this method to do postprocessing after the record is deleted. Make sure you call the parent implementation so that the event is raised properly.

Reimplemented from RedBeanModel.

Definition at line 505 of file Group.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Mon May 29 07:10:25 2017