Ejemplo n.º 1
0
 /**
  * Get all packages
  * @return array of packages
  */
 public function all()
 {
     $resources = new Resources();
     $resources->setAuthorization();
     $resources->setBaseUrl("http://backoffice.my.alfaloc.pt");
     $json = $resources->get("packagesrequest");
     $budgets = json_decode($json, true);
     if (empty($budgets)) {
         return array();
     }
     $listBudgets = array();
     foreach ($budgets as $budget) {
         $c = new Budget();
         $c->fill($budget);
         if ($c->customerNumber == Session::get("my_account_selected")) {
             $listBudgets[] = $c->toArray();
         }
     }
     return $listBudgets;
 }
Ejemplo n.º 2
0
 public function all()
 {
     $resources = new Resources();
     $resources->setAuthorization();
     $json = $resources->get("budget");
     $budgets = json_decode($json, true);
     if (empty($budgets)) {
         return array();
     }
     $listBudgets = array();
     foreach ($budgets as $budget) {
         $c = new Budget();
         $c->fill($budget);
         if ($c->customerNumber == Session::get("my_account_selected")) {
             $listBudgets[] = $c->toArray();
         }
     }
     return $listBudgets;
 }