|
const | TABLE = 'groups' |
|
const | PK = 'id_group' |
|
const | GROUPSUSERS_TABLE = 'groups_members' |
|
const | GROUPSMANAGERS_TABLE = 'groups_managers' |
|
const | MEMBER_TYPE = 0 |
|
const | MANAGER_TYPE = 1 |
|
◆ __construct()
Galette\Entity\Group::__construct |
( |
ArrayObject|int |
$args = null | ) |
|
Default constructor
- Parameters
-
null|int|ArrayObject<string,int|string> | $args Either a ResultSet row or its id for to load a specific group, or null to just instanciate object |
◆ canEdit()
Galette\Entity\Group::canEdit |
( |
Login |
$login | ) |
|
Can current logged-in user edit group
- Parameters
-
Login | $login | Login instance |
- Returns
- boolean
◆ canSetParentGroup()
Galette\Entity\Group::canSetParentGroup |
( |
Group |
$group | ) |
|
check if can Set parent group
- Parameters
-
- Returns
- boolean
◆ detach()
Galette\Entity\Group::detach |
( |
| ) |
|
Detach a group from its parent
- Returns
- boolean
◆ getCreationDate()
Galette\Entity\Group::getCreationDate |
( |
bool |
$formatted = true | ) |
|
Get group creation date
- Parameters
-
boolean | $formatted | Return date formatted, raw if false |
- Returns
- string
◆ getFullName()
Galette\Entity\Group::getFullName |
( |
| ) |
|
Get the full name of the group "foo / bar"
- Returns
- ?string
◆ getGroups()
Galette\Entity\Group::getGroups |
( |
| ) |
|
Get subgroups
- Returns
- array<int, Group>
◆ getId()
Galette\Entity\Group::getId |
( |
| ) |
|
Get group id
- Returns
- integer
◆ getIndentName()
Galette\Entity\Group::getIndentName |
( |
| ) |
|
Get the indented short name of the group " >> bar"
- Returns
- ?string
◆ getLevel()
Galette\Entity\Group::getLevel |
( |
| ) |
|
Get Level of the group
- Returns
- integer
◆ getManagers()
Galette\Entity\Group::getManagers |
( |
| ) |
|
Get groups managers
- Returns
- array<int, Adherent>
◆ getMemberCount()
Galette\Entity\Group::getMemberCount |
( |
bool |
$force = false | ) |
|
Get member count
- Parameters
-
boolean | $force | Force members load, defaults to false |
- Returns
- int
◆ getMembers()
Galette\Entity\Group::getMembers |
( |
| ) |
|
Get group members
- Returns
- array<int, Adherent>
◆ getName()
Galette\Entity\Group::getName |
( |
| ) |
|
Get group name
- Returns
- ?string
◆ getParentGroup()
Galette\Entity\Group::getParentGroup |
( |
| ) |
|
Get parent group
- Returns
- Group|null
◆ getParents()
Galette\Entity\Group::getParents |
( |
| ) |
|
Get parents as an array
- Returns
- array<int, string>
◆ isEmpty()
Galette\Entity\Group::isEmpty |
( |
| ) |
|
Is group empty? (after first deletion try)
- Returns
- boolean
◆ isManager()
Galette\Entity\Group::isManager |
( |
Login |
$login | ) |
|
Is current logged-in user manager of the group?
- Parameters
-
Login | $login | Login instance |
- Returns
- boolean
◆ load()
Galette\Entity\Group::load |
( |
int |
$id | ) |
|
Loads a group from its id
- Parameters
-
int | $id | the identifier for the group to load |
- Returns
- bool true if query succeed, false otherwise
◆ loadFromName()
Galette\Entity\Group::loadFromName |
( |
string |
$group_name | ) |
|
Load group from its name
- Parameters
-
string | $group_name | Group name |
- Returns
- bool
◆ remove()
Galette\Entity\Group::remove |
( |
bool |
$cascade = false | ) |
|
Remove specified group
- Parameters
-
boolean | $cascade | Also remove members and managers |
- Returns
- boolean
◆ setLogin()
Galette\Entity\Group::setLogin |
( |
Login |
$login | ) |
|
Set login instance
- Parameters
-
Login | $login | Login instance |
- Returns
- self
◆ setManagers()
Galette\Entity\Group::setManagers |
( |
array |
$members = [] | ) |
|
Set managers
- Parameters
-
- Returns
- bool
- Exceptions
-
◆ setMembers()
Galette\Entity\Group::setMembers |
( |
array |
$members = [] | ) |
|
Set members
- Parameters
-
- Returns
- bool
- Exceptions
-
◆ setName()
Galette\Entity\Group::setName |
( |
string |
$name | ) |
|
Set name
- Parameters
-
- Returns
- self
◆ setParentGroup()
Galette\Entity\Group::setParentGroup |
( |
int |
$id | ) |
|
Set parent group
- Parameters
-
int | $id | Parent group identifier |
- Returns
- self
◆ store()
Galette\Entity\Group::store |
( |
| ) |
|
Store the group
- Returns
- boolean
FIXME: also store members and managers?
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/galette-apidoc/checkouts/develop/galette/lib/Galette/Entity/Group.php