Find main/required attributes in data array.

@param array $data
@return array
541047
protected function _findMainAttr(array $data)
    {
        $id = $class = $value = '';

        if (Arr::key('value', $data)) {
            $value = $data['value'];
            unset($data['value']);
        }

        if (Arr::key('class', $data)) {
            $class = $data['class'];
            unset($data['class']);
        }

        if (Arr::key('id', $data)) {
            $id = $data['id'];
            unset($data['id']);
        }

        return array($data, $value, $class, $id);
    }
1007794
private function getValues(&$data) {
        $values = [];
        foreach ($data as $i => $row) {
            $skipImport = isset($this->skipImport) ? call_user_func($this->skipImport, $row) : false;
            if (!$skipImport) {
                foreach ($this->configs as $config) {
                    $value = call_user_func($config['value'], $row);
                    $values[$i][$config['attribute']] = $value;
                }
            }
        }
        //Filter unique values by unique attributes
        $values = $this->filterUniqueValues($values);
        return $values;
    }
1329146
protected function fillObjects(array $data)
    {
        $result = [];
        foreach ($data as $item) {
            $result[] = (new static())->setAttributes($item);
        }
        return $result;
    }
1094841
public static function getGlobalConfiguratorsFromData(array $data): array
    {
        assert(array_key_exists(self::KEY_GLOBAL_CONTAINER_CONFIGURATORS, $data));
        $result = $data[self::KEY_GLOBAL_CONTAINER_CONFIGURATORS];

        return $result;
    }
444731
protected function retrieveParams(array $data)/*# : array */
    {
        $params = [];
        foreach ($data as $i => $val) {
            if (0 === $i % 2) {
                $params[$val] = $data[$i + 1];
            }
        }
        return $params;
    }
875376
public function parse($data)
    {
        foreach($this->rules as $item)
        {
            if($this->checkCondition($data, $item['annotation']))
            {
                return [
                    'callable'      => $this->parseCallable([], $item['callable']),
                    'middlewares'   => $item['middlewares'] ?? [],
                ];
            }
        }
        return null;
    }
560395
protected function asArray($data)
  {
    $array = [];
    
    foreach(get_object_vars((object)$data) as $k => $v){
      if ( is_object($v) ){
        $array[$k] = $this->asArray($v);
      }
      else {
        $array[$k] = $v;
      }
    }
    
    return $array;
  }
140702
public function getIdentifyingValues(array $data)
    {
        $keys = array();

        foreach ($this->getIdentifyingProperties() as $key) {
            if ($key->isMaterializable($data)) {
                $keys[$key->getName()] = $key->materialize($data, null);
            }
        }

        return $keys;
    }
1302948
private function prepareAttributes(array $data)
    {
        foreach ($data as $key => &$value) {
            if (is_array($value)) {
                $data[$key] = $this->prepareAttributes($value);
                continue;
            }

            if (is_float($value)) {
                $value = sprintf("%01.2f", $value);
            }
        }

        return $data;
    }
158741
private function extractData(object $data): array
    {
        if ($data instanceof \stdClass) {
            return (array) $data;
        }

        $extracted = [];
        $reflection = new \ReflectionObject($data);
        foreach (
            $reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method
        ) {
            if (!$this->isGetMethod($method)) {
                continue;
            }

            $extracted[$this->getAttributeName($method)] = $method->invoke(
                $data
            );
        }

        return $extracted;
    }
104273
protected function pullOutNestedIncludedData(array $data)
    {
        $includedData = [];
        $linkedIds = [];

        foreach ($data as $value) {
            foreach ($value as $includeObject) {
                if (isset($includeObject['included'])) {
                    list($includedData, $linkedIds) = $this->serializeIncludedObjectsWithCacheKey($includeObject['included'], $linkedIds, $includedData);
                }
            }
        }

        return [$includedData, $linkedIds];
    }
746725
public function getData($data = []) {
        for ($i = ((($this->_byPage * $this->_currentPage) - $this->_byPage)); $i <= (($this->_byPage * $this->_currentPage) - 1); $i++) {
            if (isset($data[$i])) {
                array_push($this->_data, $data[$i]);
            }
        }

        return $this->_data;
    }
54655
protected function parseArrayOfPrimaryData(array $data)
    {
        $isValid = true;
        $result  = null;
        foreach ($data as $primaryData) {
            $parsed = $this->parseSinglePrimaryData($primaryData);
            if ($parsed === null) {
                $isValid = false;
            } else {
                $result[] = $parsed;
            }
        }

        return $isValid === true ? $result : null;
    }
1194675
public function parseData(array $data)
    {
        $newData = [];

        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $value = $this->parseData($value);
            }

            // If the data key contains a dot, we will replace it with another character
            // sequence so it doesn't interfere with dot processing when working with
            // array based validation rules and array_dot later in the validations.
            if (Str::contains($key, '.')) {
                $newData[str_replace('.', '->', $key)] = $value;
            } else {
                $newData[$key] = $value;
            }
        }

        return $newData;
    }
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;
    }
431725
protected function stripAttributeMarker(array $data)
    {
        foreach ($data as $key => $value) {
            if (substr($key, 0, 5) == '@xml:') {
                $data[substr($key, 5)] = $value;
                unset ($data[$key]);
            } elseif (substr($key, 0, 1) == '@') {
                $data[substr($key, 1)] = $value;
                unset ($data[$key]);
            }

            if (is_array($value)) {
                $data[$key] = $this->stripAttributeMarker($value);
            }
        }

        return $data;
    }
1316860
protected function unmapAttributes(array &$data)
    {
        $map = array_flip($this->attributeMap);
        $out = [];

        foreach ($data as $key => &$value) {
            if (isset($map[$key])) {
                $key = $map[$key];
            }
            $out[$key] = $value;
        }

        return $out;
    }