4 require_once
'Services/Payment/classes/class.ilShopVats.php';
5 require_once
'Services/Payment/classes/class.ilShopUtils.php';
39 $query =
"SELECT * FROM payment_vats "
40 .
"WHERE vat_rate = ? ";
42 $data[] = (float)$a_vat_rate;
46 $query .=
"AND vat_id != ? ";
51 $statement = $ilDB->prepare(trim(
$query), $types);
52 $result = $ilDB->execute($statement,
$data);
53 while(
$row = $ilDB->fetchObject($result))
83 $this->vat_list = array();
85 $query =
"SELECT * FROM payment_vats ";
87 if(!in_array($this->
getOrderColumn(), array(
'vat_title',
'vat_rate')))
93 $order_limit =
" ORDER BY ".$this->getOrderColumn().
" ".strtoupper($this->
getOrderDirection()).
" ";
96 $order_limit .=
"LIMIT ".$this->getListStart().
", ".$this->
getListMax();
100 while(
$row = $this->db->fetchObject(
$res))
103 $oVAT->setId(
$row->vat_id);
104 $oVAT->setTitle(
$row->vat_title);
105 $oVAT->setRate(
$row->vat_rate);
107 $this->vat_list[$oVAT->getId()] = $oVAT;
110 $res = $this->db->query(str_replace(
'*',
'COUNT(vat_id) AS num_vat_list',
$query));
111 while(
$row = $this->db->fetchObject(
$res))
113 $this->num_vat_list =
$row->num_vat_list;
126 return (
bool)count($this->vat_list);
130 return is_array($this->vat_list) ? $this->vat_list : array();
134 return reset($this->vat_list);
138 return (
bool)
current($this->vat_list);
142 return current($this->vat_list);
146 return key($this->vat_list);
150 return next($this->vat_list);
163 $this->order_column = $a_order_column;
176 return $this->order_column;
188 $this->order_direction = $a_order_column;
201 return $this->order_direction;
213 $this->list_start = $a_list_start;
226 return $this->list_start;
238 $this->list_max = $a_list_max;
251 return $this->list_max;