@param array $data Array of data

@return mixed
340878
public function build_sql( $data = null ) {

		if ( ! empty( $data ) ) {
			$this->set_data( $data );
		}

		$this->built = $data;

		return $this->built;
	}
1253136
public function serialize($data) {
        if (is_array($data)) {
            return $this->serializeArray($data);
        } else if (is_object($data)) {
            return $this->serializeItem($data);
        }

        return $data;
    }
1036926
public static function arrayColumns(array $data)
    {
        // Count the amount of values from the source input
        $count = count($data);

        if ($count === 0) {
            return false;
        }

        if ($count === 1) {
            return array_keys($data[0]);
        }

        if (isset($data[0])) {
            return array_keys($data[0]);
        } else {
            return false;
        }
    }
23104
public function resolveArray(array $data)
    {
        $self = $this;
        array_walk_recursive($data, function (&$value, $key) use ($self) {
            if (is_string($value)) {
                $value = $self->resolveString($value);
            }
        });

        return $data;
    }
1073650
protected function _format(array $data) {
		foreach (['id', 'rev'] as $key) {
			if (isset($data["_{$key}"])) {
				$data[$key] = $data["_{$key}"];
				unset($data["_{$key}"]);
			}
		}
		return $data;
	}
1363732
public function filter(array $data): array
    {
        /* @var array|DataInterface[] $result */
        $result = [];
        foreach ($data as $item) {
            $key = implode('|', $item->getKeys());
            if (!isset($result[$key]) || $result[$key]->getOrder() < $item->getOrder()) {
                $result[$key] = $item;
            }
        }
        return array_values($result);
    }
113026
public function process(array $data)
    {
        $processedData = [
            'meta' => Hash::get($data, 'meta'),
            'data' => []
        ];
        $processedData['meta']['type'] = 'Module';
        $processedData['meta']['title'] = $this->name();
        unset($data['meta']);
        foreach ($data as $attr => $value) {
            $processedData['data'][$attr] = $value;
        }
        return $processedData;
    }
1036201
private function cleanData(array $data) : array
  {
    foreach($data as $key => $value) {
      $data[$key] = $this->replace($key, $value);
    }

    return $data;
  }
456328
public function data($data = []) {
        if (count($data) == 0) {
            return $this->_data;
        }
        else {
            $this->_data = $data;
        }

        return null;
    }
1125366
public static function fromData(array $data)
    {
        $reflection = new \ReflectionClass(static::class);
        $instance = $reflection->newInstanceWithoutConstructor();
        $instance->data = $data;
        $instance->jsonUnserialize($data);
        return $instance;
    }
969600
public function transform($data)
    {
        if (is_array($data)) {
            return $data;
        }

        if (is_object($data) && $data instanceof Arrayable) {
            return $data->toArray();
        }

        return (array) $data;
    }
491690
function findOne(array $data)
    {
        $r = null;
        foreach ( $this->find($data) as $r)
            break;

        return $r;
    }
872221
protected function _getData(array $data): array
    {
        // Stringify empty values
        if (!empty($data)) {
            foreach ($data as $fieldName => $value) {
                $data[$fieldName] = $this->_stringifyEmptyValue($value);
            }
        }

        return $data;
    }
507255
public function create_data( $data = [] ) {
		if ( is_object( $data ) && method_exists( $data, 'to_array' )  ) {
			return $data->to_array();
		}

		return is_array( $data ) ? $data : [];
	}
1142036
public static function export($data)
    {
        if (is_object($data)) {
            //	Allow embedded export method for specific export
            if ($data instanceof Arrayable || method_exists($data, 'toArray')) {
                $data = $data->toArray();
            } else {
                $data = get_object_vars($data);
            }
        }

        if (!is_array($data)) {
            return $data;
        }

        $output = [];

        foreach ($data as $key => $value) {
            $output[$key] = static::export($value);
        }

        return $output;
    }
78888
public static function deserializeObject(array $data)
    {
        /** @var Bulk $result */
        $result = parent::deserializeObject($data);
        $result->maxOperations = $data['maxOperations'];
        $result->maxPayloadSize = $data['maxPayloadSize'];

        return $result;
    }
276179
protected function formatData(array $data)
    {
        $formatted = [];

        foreach ($data as $key => $value) {
            if (is_array($value)) {
                if (isset($value['value'])) {
                    $formatted[$key] = $value;

                    continue;
                }

                if (count($value) >= 2) {
                    $value = [
                        'value' => $value[0],
                        'color' => $value[1],
                    ];
                }
            } else {
                $value = [
                    'value' => strval($value),
                ];
            }

            $formatted[$key] = $value;
        }

        return $formatted;
    }