@inheritdoc

@return BaseObject[]|array The resulting elements.
777014
public function populate($rows)
    {
        $indexBy = $this->indexBy;

        if ($indexBy === null) {
            return $this->createObjects($rows);
        }
        $result = [];
        foreach ($rows as $row) {
            if (is_string($indexBy)) {
                $key = $row[$indexBy];
            } else {
                $key = call_user_func($indexBy, $row);
            }
            $result[$key] = $this->createObject($row);
        }
        return $result;
    }
600641
public function getArrayKeys()
    {
        $returnValue = [];

        foreach (array_keys($this->getArrayCopy()) as $key) {
            if ($key != '_type') {
                $returnValue[] = $key;
            }
        }

        return $returnValue;
    }
504983
public function toArray() {

		$class = new \ReflectionClass($this);
		$props = $class -> getProperties();
		$data  = [];

		foreach($props as $prop) {

			if($class -> name === $prop -> class) {

				if(true === isset($this -> {$prop -> name})) {
					$data[$prop -> name] = $this -> {$prop -> name};
				}
			}
		}

		foreach($this -> columns as $column) {
			$data[key($column)] = $column[key($column)];
		}

		return $data;
	}
641957
public function toArray() : array
    {
        $output = [];
        foreach ($this->entries as $entry) {
            $output[] = $entry instanceof ArraySerializable ? $entry->toArray() : $entry;
        }
        return $output;
    }
48373
public static function objectToArray($source): array
    {
        $result = [];

        if (is_array($source)) {
            return $source;
        }

        if (!is_object($source)) {
            return $result;
        }

        $json = json_encode($source);
        if ($json === false) {
            return $result;
        }

        $array = json_decode($json, true);
        if ($array === null) {
            return $result;
        }
        $result = $array;

        return $result;
    }
1205421
protected function buildObjectsArray()
    {
        $objects = [];
        foreach ($this->objectConfigurations as $objectConfiguration) {
            $objectName = $objectConfiguration->getObjectName();
            $objects[$objectName] = [
                'l' => strtolower($objectName),
                's' => $objectConfiguration->getScope(),
                'p' => $objectConfiguration->getPackageKey()
            ];
            if ($objectConfiguration->getClassName() !== $objectName) {
                $objects[$objectName]['c'] = $objectConfiguration->getClassName();
            }
            if ($objectConfiguration->getFactoryObjectName() !== '') {
                $objects[$objectName]['f'] = [
                    $objectConfiguration->getFactoryObjectName(),
                    $objectConfiguration->getFactoryMethodName()
                ];

                $objects[$objectName]['fa'] = [];
                $factoryMethodArguments = $objectConfiguration->getArguments();
                if (count($factoryMethodArguments) > 0) {
                    foreach ($factoryMethodArguments as $index => $argument) {
                        $objects[$objectName]['fa'][$index] = [
                            't' => $argument->getType(),
                            'v' => $argument->getValue()
                        ];
                    }
                }
            }
        }
        $this->configurationCache->set('objects', $objects);
        return $objects;
    }
405538
public function toArray(): array
    {
        $groups = [];

        foreach ($this->groups as $group) {
            $key = Key::sanitize($group['name']);

            $key = sprintf('%s_%s', $this->parentKey, $key);

            $group = [
                'field' => sprintf('field_%s', Key::hash($key)),
                'operator' => $group['operator'],
                'value' => $group['value'],
            ];

            $groups[] = $group;
        }

        return $groups;
    }
807584
public function getArrayCopy() : array
    {
        $values = get_object_vars($this);
        foreach ($values as $property => $value) {
            // Skip relations
            if (is_object($value)) {
                unset($values[$property]);
            }
        }

        return $values;
    }
237513
public function toArray(): array
    {
        return array_filter([
            'uuid' => $this->uuid->toArray(),
            'coordinate' => $this->coordinate instanceof Coordinate
                ? $this->coordinate->toArray()
                : null,
            'distance' => $this->distance,
            'metadata' => $this->metadata,
            'indexed_metadata' => $this->indexedMetadata,
            'searchable_metadata' => $this->searchableMetadata,
            'exact_matching_metadata' => $this->exactMatchingMetadata,
            'suggest' => $this->suggest,
            'highlights' => $this->highlights,
            'is_promoted' => !$this->promoted ? null : true,
            'score' => $this->score,
        ], function ($element) {
            return
            !(
                is_null($element) ||
                (is_array($element) && empty($element))
            );
        });
    }
1201301
private function recursiveDeserialize($serializedObject)
    {
        if (!is_array($serializedObject)) {
            return $serializedObject;
        } elseif ($this->dataFormatter->isSerializedObject($serializedObject)) {
            return $this->deserializeObject($serializedObject);
        } else {
            $deserializedArray = [];
            foreach ($serializedObject as $key => $value) {
                $deserializedArray[$key] = $this->recursiveDeserialize($value);
            }

            return $deserializedArray;
        }
    }
348388
public function toArray()
	{
		$output = $this->getAttributes();

		foreach ($this->relationships as $key => $value) {

			if ($value instanceof BaseModel) {
				$value = array($value->getSingularEntityName() => $value->toArray());
			}
			else {
				$value = $value->toArray();
			}

			$output = array_merge($output, $value);
		}

		return $output;
	}
948502
protected function getArrayRequest(): array
    {
        if (null === $this->arrayRequest) {
            return ArrayHelper::fromObject($this->getRequest()->call->params ?? []);
        }

        return $this->arrayRequest;
    }
1293927
public function toArray()
    {
        $array = array();
        $data  = $this->__options;
        foreach ($data as $key => $value)
        {
            if ($value instanceof KObjectConfig) {
                $array[$key] = $value->toArray();
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
263590
protected function getGeneratedProperties(): array
    {
        $reflectionObject = new \ReflectionObject($this);
        $properties = $reflectionObject->getProperties(\ReflectionProperty::IS_PUBLIC);
        $result = [];
        foreach ($properties as $property) {
            if (!$property->isPublic() || @$property->isDefault()) {
                continue;
            }

            $result[] = $property;
        }

        return $result;
    }
373758
public function toArray()
    {
        $reflection = new ReflectionObject($this);

        $properties = $this->propertiesToArray($reflection);
        $methods    = $this->methodsToArray($reflection);

        return array_merge($properties, $methods);
    }
104875
public function get(): array
    {
        $result = [];

        $filter = $this->jory->getFilter();
        if ($filter !== null) {
            $result[$this->keyRepository->get('flt')] = $this->getFilterArray($filter);
        }
        $sorts = $this->jory->getSorts();
        if (!empty($sorts)) {
            $result[$this->keyRepository->get('srt')] = $this->getSortsArray($sorts);
        }
        $relations = $this->jory->getRelations();
        if (!empty($relations)) {
            $result[$this->keyRepository->get('rlt')] = $this->getRelationsArray($relations);
        }
        if ($this->jory->getOffset() !== null) {
            $result[$this->keyRepository->get('ofs')] = $this->jory->getOffset();
        }
        if ($this->jory->getLimit() !== null) {
            $result[$this->keyRepository->get('lmt')] = $this->jory->getLimit();
        }
        if ($this->jory->getFields() !== null) {
            $result[$this->keyRepository->get('fld')] = $this->jory->getFields();
        }

        return $result;
    }
700499
public function toFullArray(): array
    {
        //convert the obj to array in order to conver to json
        $result = get_object_vars($this);

        foreach ($result as $key => $value) {
            if (preg_match('#^_#', $key) === 1) {
                unset($result[$key]);
            }
        }

        return $result;
    }