Esempio n. 1
0
 public static function getItemById($id)
 {
     if (!$id instanceof \MongoId) {
         $id = new \MongoId($id);
     }
     return parent::select()->where(array("_id" => $id))->fetch();
 }
Esempio n. 2
0
 public static function getAll($fetchMode = Identifiable::FETCH_RESULTSET, $orderBy = ['name' => 'asc'])
 {
     return parent::select()->order($orderBy)->fetch($fetchMode);
 }
Esempio n. 3
0
 /**
  * @return mixed|null
  */
 protected function getCurrentGatewayId()
 {
     if (!$this->gwId) {
         $r = new Record();
         $row = $r->select("id")->from("gateways")->where("class", "=", 'paymentwall')->where("company_id", "=", Configure::get("Blesta.company_id"))->fetch(PDO::FETCH_ASSOC);
         $this->gwId = $row ? reset($row) : null;
     }
     return $this->gwId;
 }
Esempio n. 4
0
 /**
  * Return all currencies supported by this Gateway
  *
  * @return array A numerically indexed array containing all currency codes (ISO 4217 format) this Gateway supports
  */
 public function getCurrencies()
 {
     $currencies = array();
     $record = new Record();
     $result = $record->select("code")->from("currencies")->fetchAll();
     foreach ($result as $currency) {
         $currencies[] = $currency->code;
     }
     unset($record);
     return $currencies;
 }