public function fetchAll()
 {
     $resultSet = $this->getDbTable()->fetchAll();
     $entries = array();
     foreach ($resultSet as $row) {
         $entry = new PAP_Model_Branch();
         $entry->setId($row->province_id)->setName($row->Name);
         $entries[] = $entry;
     }
     return $entries;
 }
Beispiel #2
0
 public function fetchAll()
 {
     $resultSet = $this->getDbTable()->fetchAll();
     $entries = array();
     foreach ($resultSet as $row) {
         $entry = new PAP_Model_Branch();
         $entry->setId($row->branch_id)->setUser($row->user_id)->setBranchorder($row->branch_order)->setEmail($row->branch_email)->setWebsite($row->branch_website)->setLatitude($row->latitude)->setLongitude($row->longitude)->setName($row->name)->setStreet($row->street)->setNumber($row->number)->setPhone($row->phone)->setLocal($row->local)->setLogo($row->logo)->setProvince($row->province_id)->setCity($row->city_id)->setZipcode($row->zip_code)->setCreated($row->created)->setUpdated($row->updated);
         $entries[] = $entry;
     }
     return $entries;
 }
 public function fetchAll($userId = null)
 {
     if (isset($userId)) {
         $select = $this->getDbTable()->select();
         $select->where("user_id = ?", $userId);
         $resultSet = $this->getDbTable()->fetchAll($select);
     } else {
         $resultSet = $this->getDbTable()->fetchAll();
     }
     $entries = array();
     foreach ($resultSet as $row) {
         $entry = new PAP_Model_Branch();
         $entry->setId($row->promotion_id)->setPromoCode($row->promo_code)->setUserId($row->user_id)->setStarts($row->starts)->setEnds($row->ends)->setShortDescription($row->short_description)->setLongDescription($row->long_description)->setPromoValue($row->promo_value)->setValueSince($row->value_since)->setQuantity($row->quantity)->setPromoType($row->type)->setDisplayedText($row->displayed_text)->setAlertType($row->alert_type)->setState($row->state)->setPromoCost($row->promo_cost)->setVisited($row->visited)->setCreated($row->created);
         $entries[] = $entry;
     }
     return $entries;
 }