Return an array of an object as an unmapped aray, useful for dumping defaults

@return array
340707
public function getUnmappedArray(DataObject $object)
    {
        $output = [];

        foreach ($this->mapping as $unmappedField => $mappedField) {
            if (strpos($mappedField, ':') !== false) {
                list($mappedField, $modifier) = explode(':', $mappedField);
            }

            $output[$unmappedField] = $object->{$mappedField};
        }

        return $output;
    }
767413
protected function getUnsettedKeys()
    {
        $unsettedKeys = [];

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

            if (!array_key_exists($key, $this->_attributes)) {
                $unsettedKeys[] = $key;
                continue;
            }
        }

        return $unsettedKeys;
    }
276049
public function toArray(): array
	{
		$array = [
			'id' => $this->getId(),
		];
		foreach (get_object_vars($this) as $prop => $value) {
			$array[$prop] = is_callable([$this->$prop,'toArray'])? $this->$prop->toArray() : $this->$prop;
		}

		return $array;
	}
74253
public function asArray()
    {
        $a = get_object_vars($this);
        $a['showing_from'] = $this->showingFrom;
        $a['showing_to'] = $this->showingTo;

        // remove manager object from array
        unset($a['manager']);

        return $a;
    }
447787
protected function getDefaultObjectStates()
    {
        $defaultObjectStatesMap = array();
        $objectStateHandler = $this->persistenceHandler->objectStateHandler();

        foreach ($objectStateHandler->loadAllGroups() as $objectStateGroup) {
            foreach ($objectStateHandler->loadObjectStates($objectStateGroup->id) as $objectState) {
                // Only register the first object state which is the default one.
                $defaultObjectStatesMap[$objectStateGroup->id] = $objectState;
                break;
            }
        }

        return $defaultObjectStatesMap;
    }
1359050
public function toArray()
    {
        $arrayConfig = [];
        foreach (get_object_vars($this) as $key => $value) {
            if (is_object($value)) {
                if (method_exists($value, 'toArray')) {
                    $arrayConfig[$key] = $value->toArray();
                } else {
                    $arrayConfig[$key] = $value;
                }
            } else {
                $arrayConfig[$key] = $value;
            }
        }
        return $arrayConfig;
    }
584026
public function toArray()
    {
        return [
            $this->id,
            $this->filterName,
            $this->operator,
            serialize($this->value),
        ];
    }
359788
public function toArray()
    {
        $array = ['name' => $this->getName()];

        foreach (static::$propertyMap[static::class] as $name => $property) {
            $value = $this->{$name};
            $array[$name] = $value instanceof XType ? $value->toArray() : $value;
        }

        if (!count($this->constraints)) {
            return $array;
        }

        $array['constraints'] = [];

        foreach ($this->constraints as $name=>$parameters) {
            $array['constraints'][$name] = $parameters;
        }

        return $array;
    }
1043480
public function toArray()
    {
        return array_map(static function ($value) {
            if ($value instanceof ArraySerializableInterface) {
                $value = $value->toArray();
            }
            return $value;
        }, get_object_vars($this));
    }
29239
public function getMap()
    {
        if (isset($this->raw->map)) {
            $map = array();

            foreach ((array) $this->raw->map as $item) {
                $processed = array();

                foreach ($item as $match => $replace) {
                    $processed[Path::canonical($match)] = Path::canonical($replace);
                }

                if (isset($processed['_empty_'])) {
                    $processed[''] = $processed['_empty_'];

                    unset($processed['_empty_']);
                }

                $map[] = $processed;
            }

            return $map;
        }

        return array();
    }
220038
public function toArray()
    {
        $data = parent::toArray();

        foreach(array_keys($data) as $key)
        {
            if (substr($key, 0, 1) === '_') {
                unset($data[$key]);
            }
        }

        return $data;
    }
618343
public function toArray()
    {
        return array(
            'name' => $this->_name,
            'type' => $this->_datatype,
            'length' => $this->_length,
            'notnull' => $this->_notnull,
            'default' => $this->_default,
            'autoincrement' => $this->_autoIncrement,
            'comment' => $this->_comment,
        );
    }
1340824
public function toArray()
    {
        return [
            'field' => $this->getRawProperty('field'),
            'from-field' => $this->getRawProperty('fromField'),
            'to-field' => $this->getRawProperty('toField'),
            'is-deleted' => $this->isDeleted,
            'is-added' => $this->isAdded,
        ];
    }
538481
public function getMappedAttributes()
    {
        $mappedArrayForApiRequest = [];
        $requestAttributes = $this->request->getData();
        foreach ($requestAttributes as $key => $value) {
            if (array_key_exists($key, $this->mappingRequestToOtherRequestAttributes)) {
                $mappedArrayForApiRequest[$this->mappingRequestToOtherRequestAttributes[$key]] = $value;
            }
        }

        return $mappedArrayForApiRequest;
    }
1161453
public function toArray()
    {
        $attr = !empty($this->getWarden()) ? $this->getWarden() : null;
        if (empty($attr)) {
            $attr = empty($this->getVisible()) ? $this->getFillable() : $this->getVisible();
        }
        $returnable = [];

        $f_model = \FormModel::using('plain')->withModel($this);
        foreach ($attr as $old => $new) {
            if (!empty($relations = $f_model->getRelationalDataAndModels($this, $old))) {
                $returnable[$new] = $relations;
            }
            if (stripos($old, '_id') !== false) {
                if (!empty($this->$new)) {
                    $returnable[$new] = $relations;
                }
            } else {
                if (isset($this->$old)) {
                    $returnable[$new] = $this->$old;
                }
            }
        }

        return $returnable;
    }
421688
protected function getAttributesDictionnary() : array
    {
        // Get attributes that belongs to the embedded object
        $embeddedAttributeKeys = $this->getEmbeddedObjectAttributes();

        $attributesMap = [];

        // Build a dictionary for corresponding object attributes => parent attributes
        foreach ($embeddedAttributeKeys as $key) {
            $attributesMap[$key] = $this->getParentAttributeKey($key);
        }

        return $attributesMap;
    }
1300317
public function toArray()
    {
        $result = [];

        ArrayList::of($this->getFillable())
            ->append(ArrayList::of($this->getVisible()))
            ->unique(SORT_STRING)
            ->exceptValues($this->getHidden())
            ->each(function ($key) use (&$result) {
                $getter = vsprintf('get%s', [Str::studly($key)]);

                if (method_exists($this, $getter)) {
                    $result[$key] = $this->$getter();

                    return;
                }

                $camel = Str::camel($key);
                $result[$key] = $this->$camel;
            });

        return $result;
    }