示例#1
0
 /**
  * @param array $result
  * @return DBRecord
  */
 protected function createFromResultSet(array $result)
 {
     $group = new Group();
     $group->setId($result['id']);
     $group->setName($result['name']);
     $group->setDescription($result['description']);
     $dc = new DateTime();
     $dc->setTimestamp($result['dateCreated']);
     $group->setDateCreated($dc);
     return $group;
 }
示例#2
0
 public function isMemberOfGroup(Group $group)
 {
     foreach ($this->getGroups() as $g) {
         if ($g->getId() == $group->getId()) {
             return true;
         }
     }
     return false;
 }
示例#3
0
 public function removeGroup(RoleInterface $user, Group $group)
 {
     $stmt = $this->getConnection()->prepare('DELETE FROM test_group_members WHERE id_u=:u && id_g=:g');
     $stmt->bindValue(':u', $user->getId());
     $stmt->bindValue(':g', $group->getId());
     return $this->customQuery($stmt);
 }