Proxy method to retrieve data to populate select lists.
@return array
@throws \Vegas\Forms\DataProvider\Exception\NotFoundException When DI is not configured properly or a wrong value is provided.
12256
public function getDataFromProvider()
    {
        $select = $this->get(self::DATA_PARAM);
        if(is_null($select->getValue())) {
            return array();
        }
        $classname = $select->getValue();
        if (!class_exists($classname) || !array_key_exists($classname, $select->getOptions())) {
            throw new NotFoundException;
        }
        return (new $classname)->getData();

    }
132357
public function getAsArray(): array
	{
		$data = [];

		foreach ($this->getBindings() as $bind) {
			$data[$bind->getParameter()] = $bind->getValue();
		}

		return $data;
	}
109623
public function get()
    {
        $sql = "SELECT * FROM `$this->_table` ";

        $this->_param_list = array();

        if (!empty($this->_where_list)) {
            $sql .= "WHERE ";
            $first = true;
            foreach ($this->_where_list as $field_name => $field_settings) {
                $type          = isset($field_settings['type']) ? $field_settings['type'] : false;
                $field_value   = $field_settings['value'];
                $field_connect = isset($field_settings['op']) ? $field_settings['op'] : ' AND ';

                switch ($type) {
                    case 'like':
                        $sql .= ($first !== true ? "$field_connect" : "") . "$field_name like '%:$field_name%'";
                        $this->_param_list[] = array(":$field_name", $field_value);
                        break;
                    case 'in':
                        $sql .= ($first !== true ? "$field_connect" : "") . "$field_name IN (:$field_name)";
                        $this->_param_list[] = array(":$field_name", $field_value);
                        break;
                    default:
                        $sql .= ($first !== true ? "$field_connect" : "") . "$field_name = :$field_name";
                        $this->_param_list[] = array(":$field_name", $field_value);
                        break;
                }

                // we can assume that after the first iteration it's false
                $first = false;
            }
        }
        unset($field_connect, $field_name, $field_value, $type, $field_settings);

        if (!empty($this->_group)) {
            if (is_array($this->_group)) {
                $this->_limit = implode(',', $this->_group_by);
            }

            $sql .= ' GROUP BY ' . $this->_group_by;
        }

        if (!empty($this->_limit)) {
            if (is_array($this->_limit)) {
                $this->_limit = implode(',', $this->_limit);
            }

            $sql .= ' LIMIT ' . $this->_limit;
        }

        $this->last_sql = $sql;

        $this->__init_database();

        $stmt = $this->db->prepare($sql);
        // set the prepared statement
        for ($i = 0, $c = count($this->_param_list); $i < $c; $i++) {
            $stmt->bindParam($this->_param_list[$i][0], $this->_param_list[$i][1]);
        }


        if (!$stmt->execute()) return;

        $this->result = $stmt->fetchAll(MySQL::FETCH_OBJ);
    }
1372961
public static function toSelectArray(): array
    {
        $array = static::toArray();
        $selectArray = [];

        foreach ($array as $key => $value) {
            $selectArray[$value] = static::getDescription($value);
        }

        return $selectArray;
    }
641213
public function handle_get_data() {
        $url = new UrlHelper ();
        $pageNumber = $url->get('pageNumber', 1);
        $perPage = $url->get('perPage', 10);
        $filters = $url->get("filters_json", "[]");

        $params = array(
            'skip' => ($pageNumber - 1) * $perPage,
            'take' => $perPage,
            'filters_json' => $filters
        );
        return array(
            'type' => 'json',
            'data' => array (
                'rows' => $this->dataProvider->getData($params)
            )
        );
    }
362968
public function getValueSelectOptions()
    {
        if (!$this->hasData('value_select_options')) {
            $this->setData(
                'value_select_options',
                $this->sourceYesno->toOptionArray()
            );
        }

        return $this->getData('value_select_options');
    }
302770
public function getList()
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        
        $selectedProcess = $this->params()->fromQuery('process', array());
        if (empty($selectedProcess))
            $selectedProcess = array();
        $selectedLevels = $this->params()->fromQuery('levels', array());
        if (empty($selectedLevels))
            $selectedLevels = array();
        $alerts = $this->getAlertDataHandler()->getAlertsForProcess($selectedProcess, $selectedLevels);
        $response = $this->getResponse();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $serializer = $this->getSerializer();
        $alertssJson = $serializer->serialize($alerts, 'json');
        $response->setContent($alertssJson);
        return $response;
    }
1317661
protected function load_selected_users() {
        // See if we got anything.
        if ($this->multiselect) {
            $userids = optional_param_array($this->name, array(), PARAM_INT);
        } else if ($userid = optional_param($this->name, 0, PARAM_INT)) {
            $userids = array($userid);
        }
        // If there are no users there is nobody to load.
        if (empty($userids)) {
            return array();
        }

        // If we did, use the find_users method to validate the ids.
        $this->validatinguserids = $userids;
        $groupedusers = $this->find_users('');
        $this->validatinguserids = null;

        // Aggregate the resulting list back into a single one.
        $users = array();
        foreach ($groupedusers as $group) {
            foreach ($group as $user) {
                if (!isset($users[$user->id]) && empty($user->disabled) && in_array($user->id, $userids)) {
                    $users[$user->id] = $user;
                }
            }
        }

        // If we are only supposed to be selecting a single user, make sure we do.
        if (!$this->multiselect && count($users) > 1) {
            $users = array_slice($users, 0, 1);
        }

        return $users;
    }
439634
protected function getDropdownValues()
    {
        if ($source = array_get($this->field->options(), 'value_source')) {

            $values = $this->getDropdownValuesFromSource($source);

            if (false !== $values) {
                return $values;
            }
        }

        return array_get($this->field->options(), 'values', []);
    }
863305
public function getData()
    {
        foreach ($this->data as $value) {
            $this->validateDefinitions($value);
        }
        return ['data' => $this->data, 'parent_aliases' => $this->parentAliases];
    }
579755
public function load()
    {
        $data = [];

        $settings = $this->database->select('SELECT * FROM '.$this->table);

        foreach ($settings as $setting) {
            $id = $setting->id;
            $value = $setting->value;

            $decoded = json_decode($value, 1, 512);
            if (is_array($decoded)) {
                $value = $decoded;
            }

            Arr::set($data, $id, $value);
        }

        return $data;
    }
520710
public function getDataRows()
    {
        $list = array();
        foreach ($this->components as $child) {
            if ($child instanceof DataRow) {
                $list[] = $child;
            }
        }
        return $list;
    }
28748
private function getDatatableOptions(): array
    {
        list($plugin, $controller) = pluginSplit($this->entity->get('model'));

        $result = [
            'table_id' => '#' . $this->getTableId(),
            'order' => [$this->getOrderField(), $this->getOrderDirection()],
            'ajax' => [
                'url' => Router::url([
                    'plugin' => $plugin,
                    'controller' => $controller,
                    'action' => $this->action,
                    $this->preSaveId
                ]),
                'columns' => $this->getDatatableColumns(),
                'extras' => ['format' => 'pretty']
            ],
        ];

        if (! $this->getGroupByField() && $this->batch) {
            $result['batch'] = ['id' => Configure::read('Search.batch.button_id')];
        }

        return $result;
    }
844931
public function getFormattedChoices()
    {
        $ret    = [];
        $loaded = [];

        // Populate the raw formatted array with just values as values
        foreach (array_keys($this->choices) as $value) {
            $ret[$value] = $value;
        }

        // First start with arbitrarily set choices map
        if ($this->choicesMap) {
            $loaded = array_intersect_key($this->choicesMap, $ret);
        }

        // Execute the user given callback
        if ($this->choicesCallback) {

              $callbackLoaded = call_user_func(
                  $this->choicesCallback,
                  // Exclude already loaded items to leave the choices map
                  // having precedence over the callback
                  array_diff_key($ret, $loaded)
              );

              // We are forced to proceed to a two step merge (using foreach)
              // else array_merge() as well as the + operator would terribly
              // fail merging integer keys
              if ($callbackLoaded) {
                  foreach ($callbackLoaded as $value => $title) {
                      $loaded[$value] = $title;
                  }
              }
        }

        // Append the count for each value
        foreach ($this->choices as $value => $count) {
            $append = ' <span class="badge">' . $count . '</span>';
            if (isset($loaded[$value])) {
                $ret[$value] = $loaded[$value] . $append;
            } elseif(!$this->exclusiveMode) {
                $ret[$value] .= $append;
            }
            else {
                unset($ret[$value]);
            }
        }

        return $ret;
    }
545029
public function getData()
    {
        $this->setDefaults();

        $this->validate(
            'partner',
            '_input_charset',
            'refund_date',
            'batch_no',
            'refund_items'
        );

        $this->validateOne(
            'seller_user_id',
            'seller_email'
        );

        $this->setBatchNum(count($this->getRefundItems()));
        $this->setRefundDetail($this->getDetailData());

        $data = [
            'service'        => $this->service,
            'partner'        => $this->getPartner(),
            'notify_url'     => $this->getNotifyUrl(),
            'seller_user_id' => $this->getPartner(),
            'refund_date'    => $this->getRefundDate(),
            'batch_no'       => $this->getBatchNo(),
            'batch_num'      => $this->getBatchNum(),
            'detail_data'    => $this->getDetailData(),
            '_input_charset' => $this->getInputCharset(),
        ];

        $data['sign'] = $this->sign($data, $this->getSignType());
        $data['sign_type'] = $this->getSignType();

        return $data;
    }
303503
public function getData()
    {
        $fieldsets = $this->grid->fieldsets;
        $controls  = [];
        foreach ($fieldsets as $fieldset) {
            foreach ($fieldset->controls() as $control) {
                array_push($controls, $control->name);
            }
        }
        $keys = $this->resolveWithMultiples($controls);
        return array_only(inputs(), $keys);
    }
1155204
private function populate() {
	
		$res = Database::load('SELECT * FROM `options` ORDER BY `group`');
			
		$this->list = array();
			
		foreach ($res as $o) {
			
			// esplode le options
			if ('list'==$o->type) {
				
				$listItems = explode('|', $o->list_options);
				
				foreach ($listItems as $listEntry) {
					
					list ($val,$text)	= explode(',', $listEntry);
					
					$listItem = new \stdClass();
					
					$listItem->value = $val;
					$listItem->text  = $text;
					
					$o->listItems[] = $listItem;
					
				}
				
			}

			// casting
			$o->value = $this->castTo($o->value, $o->type);
			
			$this->list[$o->name] = $o;
			
		}
	
	}