Gets the results and a multidimensional array.

@return array|null The results as an array or null if this was not a select or if there was an error.
760128
public function toArray() : ?array
    {
        if (null === $this->stmt || false === $this->stmt) {
            return null;
        }
        return $this->stmt->toArray();
    }
1237449
public function toArray()
    {
        $result = [];

        if (!empty($this->value)) {
            if (!empty($this->details)) {
                $parts = explode('.', $this->value);
                $result['value'] = join('.', array_slice($parts, 0, $this->details));
            } else {
                $result['value'] = $this->value;
            }
        }

        if (!empty($this->alias)) {
            $result['alias'] = $this->alias;
        }

        if (!empty($this->nickname)) {
            $result['nickname'] = $this->nickname;
        }

        if (isset($result['value']) && !isset($result['alias']) && !isset($result['nickname'])) {
            return $result['value'];
        }

        return $result;
    }
573004
public function select(): array
	{
		$sql  = $this->query->getPrefix();
		$sql .= $this->setOperations($this->query->getSetOperations());
		$sql .= $this->query->isDistinct() ? 'SELECT DISTINCT ' : 'SELECT ';
		$sql .= $this->columns($this->query->getColumns(), true);
		$sql .= $this->from($this->query->getTable());
		$sql .= $this->joins($this->query->getJoins());
		$sql .= $this->wheres($this->query->getWheres());
		$sql .= $this->groupings($this->query->getGroupings());
		$sql .= $this->havings($this->query->getHavings());
		$sql .= $this->orderings($this->query->getOrderings());
		$sql .= $this->limit($this->query->getLimit());
		$sql .= $this->offset($this->query->getOffset());
		$sql .= $this->lock($this->query->getLock());

		return ['sql' => $sql, 'params' => $this->params];
	}
1002835
public function fetchFirst(): ?array
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        $this->resetLimit()->limit(0, 1);
        $results = $this->fetchAll();
        return isset($results[0]) ? $results[0] : null;
    }
181383
public function getResult(): array
    {
        $result =
            (count($this->rejectedAttributes) > 0)
            ? $this->rejectedAttributes
            : []
        ;
        $this->rejectedAttributes = [];
        return $result;
    }
356938
public function toArray() {
        $arr = array_filter(
                array(
                    'v' => $this->getValueForArray(),
                    'f' => $this->f,
                    'p' => $this->p,
                ), function ($val) { return !is_null($val);}
        );
        // mm, some charts don't work if 'v' is not present
        if (!isset($arr['v'])) {
            $arr['v'] = null;
        }
        return $arr;
    }
815070
public function get_results() {
        if (!is_null($this->plan)) {
            return $this->plan->get_results();
        } else {
            debugging('Attempting to get results of a task not binded with a plan', DEBUG_DEVELOPER);
            return null;
        }
    }
99214
public function toArray()
    {
        $data = [
            'name' => $this->getName(),
            'text' => $this->getText(),
            'type' => $this->getType(),
            'style' => $this->getStyle(),
        ];

        if($this->getUrl()) $data['url'] = $this->getUrl();
        if($this->getValue()) $data['value'] = $this->getValue();
        if($this->getConfirm()) $data['confirm'] = $this->getConfirm()->toArray();
        if($this->getOptions()) $data['options'] = $this->getOptions();
        if($this->getOptionGroups()) $data['option_groups'] = $this->getOptionGroups();
        if($this->getDataSource()) $data['data_source'] = $this->getDataSource();
        if($this->getSelectedOptions()) $data['selected_options'] = $this->getSelectedOptions();
        if($this->getMinQueryLength()) $data['min_query_length'] = $this->getMinQueryLength();

        return $data;
    }
20678
public function getResults()
    {
        $list = (array) $this->parent->getAttributeFromArray($this->localKey);
        $result = [];

        foreach ($list as $index => $item) {
            $result[$index] = $model = $this->related->newInstance([], true);
            $model->setId($index);
        }

        return collect($result);
    }
33930
public function getResults()
	{
		if (!isset($this->resultset))
		{
			$this->run();
		}

		$documents = array();
		foreach ($this->resultset as $document)
		{
			array_push($documents, $document);
		}

		foreach ($documents as &$document)
		{
			$document = $document->getFields();
		}

		return $documents;
	}
479351
public function toArray()
    {
        $result = [];

        if (!empty($this->name)) {
            $result['name'] = $this->name;
        }

        if (!empty($this->family)) {
            $result['family'] = $this->family->toArray();
        }

        if (!empty($this->alias)) {
            $result['alias'] = $this->alias;
        }

        if (!empty($this->edition)) {
            $result['edition'] = $this->edition;
        }

        if (!empty($this->version)) {
            $result['version'] = $this->version->toArray();
        }

        if (isset($result['version']) && empty($result['version'])) {
            unset($result['version']);
        }

        return $result;
    }
643011
public function getAllResultsAsArray(): array
    {
        $result = array();

        $entities = $this->getAllResults();

        // Convert search results to array
        foreach ($entities as $entity) {
            if (is_object($entity) && method_exists($entity, 'getValues')) {
                $result[] = $entity->getValues();
            } else {
                $result[] = (array)$entity;
            }
        }

        return $result;
    }
316560
public function toArray()
    {
        $arr = array();
        foreach ($this as $key => $value) {
            $method = 'get' . $key;
            if (method_exists($this, $method)) {
                $arr[$key] = $this->$method();
            }
        }

        return $arr;
    }
963322
public function toArray(): array
    {
        return [
            'name' => $this->name,
            'text' => $this->text,
            'style' => $this->style,
            'type' => $this->type,
            'value' => $this->value,
            'confirm' => $this->confirm ? $this->confirm->toArray() : null,
        ];
    }
646060
public function getArray()
    {
        if (!$this->result) {
            return array();
        } // No hay manipuladores
        if (!is_array($this->result)) {
            return array($this->result);
        } // El resultado es solo 1, generar un array
        return $this->result; //
    }
281711
public function toArray()
    {
        $result = [];

        if (!empty($this->name)) {
            $result['name'] = $this->name;
        }

        if (!empty($this->alias)) {
            $result['alias'] = $this->alias;
        }

        if (!empty($this->using)) {
            $result['using'] = $this->using->toArray();
        }

        if (!empty($this->family)) {
            $result['family'] = $this->family->toArray();
        }

        if (!empty($this->version)) {
            $result['version'] = $this->version->toArray();
        }

        if (!empty($this->type)) {
            $result['type'] = $this->type;
        }

        if (isset($result['version']) && empty($result['version'])) {
            unset($result['version']);
        }

        return $result;
    }
889781
public function getValuesAsArray() {
		$values = [];
		foreach($this->getValues() as $value) {
			$values[$value->getId()] = $value->getName();
		}

		return $values;
	}