/** * @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; }
public function isMemberOfGroup(Group $group) { foreach ($this->getGroups() as $g) { if ($g->getId() == $group->getId()) { return true; } } return false; }
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); }