PicoraUserGroup

Represents a group that a given PicoraUser belongs to.

extends PicoraActiveRecord implements ArrayAccess

The PicoraUser package creates a very simple User / Group model. By default each PicoraUserGroup object only contains a name, but has the magic association methods because it hasandbelongstomany PicoraUsers. This package assumes you will code in each group's role in your application.

$admin_group = PicoraActiveRecord::findByField('PicoraUserGroup','name','admin');
print $admin_group->getPicoraUserCount();
foreach($admin_group->getPicoraUserList() as $user)
    print $user->name;

Declared in: PicoraUser.php

class PicoraUserGroup extends PicoraActiveRecord {
    const PRIMARY_KEY = 'id';
    const TABLE_NAME = 'user_groups';
}