public function loadByUserAndGroupId(UserAccountModel $user, $groupID) { global $DB; $stat = $DB->prepare("SELECT user_watches_group_information.* FROM user_watches_group_information WHERE user_account_id =:user_account_id AND group_id=:group_id"); $stat->execute(array('user_account_id' => $user->getId(), 'group_id' => $groupID)); if ($stat->rowCount() > 0) { $uws = new UserWatchesGroupModel(); $uws->setFromDataBaseRow($stat->fetch()); return $uws; } }
public function fetchAll() { $this->buildStart(); $this->build(); $this->buildStat(); $results = array(); while ($data = $this->stat->fetch()) { $uwgm = new UserWatchesGroupModel(); $uwgm->setFromDataBaseRow($data); $results[] = $uwgm; } return $results; }