|
@@ -49,10 +49,10 @@ class Webservice
|
|
|
*
|
|
|
* @return array
|
|
|
*/
|
|
|
- public function getChoices($webservice, $params = array())
|
|
|
+ public function getChoices($webservice, $params = array(), $qbCriteria = false, $order_by = array(), $limit = 20, $offset = null)
|
|
|
{
|
|
|
$choices = array();
|
|
|
- $results = $this->getArray($webservice, $params);
|
|
|
+ $results = $this->getArray($webservice, $params, $qbCriteria, $order_by, $limit, $offset);
|
|
|
foreach ($results as $row) {
|
|
|
if (isset($row['name']) && isset($row['id'])) {
|
|
|
$choices[$row['name']] = $row['id'];
|
|
@@ -70,13 +70,13 @@ class Webservice
|
|
|
*
|
|
|
* @return array
|
|
|
*/
|
|
|
- public function getArray($webservice, $params = array())
|
|
|
+ public function getArray($webservice, $params = array(), $qbCriteria = true, $order_by = array(), $limit = 20, $offset = null)
|
|
|
{
|
|
|
$results = array();
|
|
|
if ($this->serviceContainer->hasParameter($webservice)) {
|
|
|
try {
|
|
|
// Por defecto agrega filters[qb-criteria] y limit=20
|
|
|
- $url = $this->buildUrl($webservice, $params, true);
|
|
|
+ $url = $this->buildUrl($webservice, $params, $qbCriteria, $order_by, $limit, $offset);
|
|
|
$results = json_decode($this->makeGetRequest($url), true);
|
|
|
} catch (\Exception $ex) {
|
|
|
$this->log($ex->getMessage(), 'error');
|