Maps numeric array to assoc. Array

@param array $data numeric indices

@return array assoc. indices
323889
protected function mapFields($data)
    {
        $result = [];
        $index = 0;

        foreach ($this->csvFileFieldsOrder as $value) {
            if (!empty($value)) {
                if (strtolower($data[$index]) == 'null') {
                    $result[$value] = null;
                } else {
                    $result[$value] = $data[$index];
                }
            }
            $index++;
        }

        return $result;
    }
1023740
protected function toArray($data)
	{
	    if (is_array($data)) {
	        return $data;
	    }
	    
	    if (is_object($data)) {
	        if (method_exists($data, 'toArray')) {
	            return $data->toArray();
	        }
	        if ($data instanceof \Traversable) {
	            return iterator_to_array($data);
	        }
	    }
	    
	    return (array) $data;
	}
1310940
protected function toArrayRecursive($data)
    {
        if (is_array($data) || is_object($data)) {
            $result = [];
            foreach ($data as $key => $value) {
                if ($key === "mappingClasses" || $key === "propNameMap") {
                    continue;
                }
                $propNameMap = $key;
                $obj = $this;
                if (is_object($data)) {
                    $obj = $data;
                }

                if (property_exists($obj, $propNameMap)) {
                    $ourPropertyName = array_search($propNameMap, $obj->propNameMap);

                    if ($ourPropertyName) {
                        $propNameMap = $ourPropertyName;
                    }
                }

                if (is_object($value) && method_exists($value, "getAll")) {
                    if (method_exists($obj, 'toArrayRecursive')) {
                        $result[$propNameMap] = $obj->toArrayRecursive($value->getAll());
                    }
                } else if ($value !== null) {
                    if (method_exists($obj, 'toArrayRecursive')) {
                        $result[$propNameMap] = $obj->toArrayRecursive($value);
                    }
                }
            }
            return $result;
        }
        return $data;
    }
214034
public static function createMultiple(array $data)
    {
        $items = [];

        foreach ($data as $action) {
            $items[] = new self($action);
        }

        return $items;
    }
1101347
public static function createFromArray(array $data): RetryMap
    {
        $retryMap = new RetryMap();
        foreach ($data as $entry) {
            $retryMap->addRetry(Retry::createFromArray($entry));
        }

        return $retryMap;
    }
920743
protected function mapData($data)
    {
        $values = array();

        foreach ($data->buckets as $bucket) {
            $values[$bucket->key] = $bucket->doc_count;
        }

        return $values;
    }
191288
private function itemsFromArray(array $data): array
    {
        $objects = [];
        foreach ($data[$this->key()] as $objectData) {
            $objects[] = $this->item->from($objectData);
        }
        return $objects;
    }
1076176
public function map($data)
    {
        $data = $this->parseToArray($data);
        $this->clearDynamic($data);

        // Parse each specified field
        foreach ($this->schema->fields as $key => $fieldType) {
            $data[$key] = $this->parseField($data[$key] ?? null, $fieldType);
        }

        return $data;
    }
536448
protected function flatten(array $data): array
    {
        $result = [];
        foreach ($data as $key => $value) {
            $item = [
                'label' => $value['label'],
                'inactive' => $value['inactive']
            ];

            $result[$key] = $item;

            if (isset($value['children'])) {
                $result = array_merge($result, $this->flatten($value['children']));
            }
        }

        return $result;
    }
1359757
public function toAssociative($data) {
	foreach ($data as $i => $value) {
		$headerName = $this->headers[$i];
		$data[$headerName] = $value;
		unset($data[$i]);
	}

	return $data;
}
1243550
public function transform($data)
    {
        if (is_array($data)) {
            return array_map([$this, 'parseNumeric'], $data);
        }

        return $this->parseNumeric($data);
    }
388367
protected function byAssociations(array $data): array
    {
        $result = [];
        foreach ($this->getAssociationsBySearchData($data) as $association) {
            // skip non-supported associations
            if (!in_array($association->type(), Options::getSearchableAssociations())) {
                continue;
            }

            $targetTable = $association->getTarget();

            // skip associations with itself
            if ($targetTable->getTable() === $this->table->getTable()) {
                continue;
            }

            $primaryKeys = [];
            foreach ((array)$targetTable->getPrimaryKey() as $primaryKey) {
                $primaryKeys[] = $targetTable->aliasField($primaryKey);
            }

            // instantiate Search on related table
            $search = new Search($targetTable, $this->user);

            $select = array_diff($search->getSelectClause($data), $primaryKeys);
            if (!empty($select)) {
                $result[$association->getName()]['select'] = $select;
            }

            $where = $search->getWhereClause($data);
            if (!empty($where)) {
                $result[$association->getName()]['where'] = $where;
            }
        }

        return $result;
    }
461879
public static function makeNested(array $data): array
    {
        $result = [];
        foreach ($data as $key => $value) {
            $keyParts = explode(':', $key);
            $current =& $result;
            foreach (static::tail($keyParts) as $keyPart) {
                if (!array_key_exists($keyPart, $current)) {
                    $current[$keyPart] = [];
                }
                $current =& $current[$keyPart];
            }
            $current[static::end($keyParts)] = $value;
        }
        return $result;
    }
913438
private function populateWith(array $data): array
    {
        $newData = [];
        foreach ($data as $row) {
            $tmp = [];
            foreach ($row as $key => $value) {
                if (false !== strpos($key, '__')) {
                    list($prefix, $postfix) = explode('__', $key);
                    if (!isset($tmp[$prefix])) {
                        $tmp[$prefix] = [];
                    }
                    $tmp[$prefix][$postfix] = $value;
                } else {
                    $tmp[$key] = $value;
                }
            }
            $newData[] = $tmp;
        }

        return $newData;
    }
233067
public function toArray($data)
    {
        $doc = new DomDocument('1.0', 'UTF-8');
        $doc->loadXML($data);
        $element = $doc->documentElement;

        return $this->convertDOMElementToArray($element);
    }
1239851
public function arraySerialize(array $Data)
    {
        $Result = "";
        foreach ($Data as $Value) {
            if ($Result == "") {
                $Result = floor($Value);
            } else {
                $Result = $Result . "," . floor($Value);
            }
        }

        return $Result;
    }
30238
public function initFromArray(array $data) {

        $unknownFields = [];

        foreach ($data as $k => $v) {

            if (empty($v)) {
                continue;
            }

            $setter = 'set' . ucfirst(str_replace('_', '', ucwords($k, '_')));

            if (method_exists($this, $setter)) {
                $this->{$setter}($v);
                continue;
            }

            $unknownFields[$k] = $v;

        }

        if (!empty($unknownFields)) {
            trigger_error('Encountered unknown fields in response: ' . json_encode($unknownFields));
        }

        return $this;

    }