Convert every attributes to value / arrays.

@return array
425210
public function toArray()
    {
        // First, call the trait method before filtering
        // with Entity specific methods
        $attributes = $this->attributesToArray($this->attributes);

        foreach ($this->attributes as $key => $attribute) {
            if (in_array($key, $this->hidden)) {
                unset($attributes[$key]);
                continue;
            }
            if ($this->hasGetMutator($key)) {
                $method = 'get'.$this->getMutatorMethod($key);
                $attributes[$key] = $this->$method($attribute);
            }
        }

        return $attributes;
    }
1237449
public function toArray()
    {
        $result = [];

        if (!empty($this->value)) {
            if (!empty($this->details)) {
                $parts = explode('.', $this->value);
                $result['value'] = join('.', array_slice($parts, 0, $this->details));
            } else {
                $result['value'] = $this->value;
            }
        }

        if (!empty($this->alias)) {
            $result['alias'] = $this->alias;
        }

        if (!empty($this->nickname)) {
            $result['nickname'] = $this->nickname;
        }

        if (isset($result['value']) && !isset($result['alias']) && !isset($result['nickname'])) {
            return $result['value'];
        }

        return $result;
    }
1085778
public function __toArray($attributes = array()){

        if( empty($attributes) ){
            $data = $this->_data;
        }else{

            $data = array();
            foreach( $attributes as $attribute ){
                if( isset($this->_data[$attribute]) ){
                    $data[$attribute] = $this->_data[$attribute];
                } else {
                    $data[$attribute] = NULL;
                }
            }

        }

        foreach( $data as $key => $item ){
            if( $item instanceof AppObject ){
                $item = $item->toArray();
                $data[$key] = $item;
            }
        }

        return $data;
    }
231313
public function toArray(): array
    {
        $data = [
            'version' => $this->getVersion()
        ];

        if ($this->hasMetadata()) {
            $data['meta'] = $this->getMetadata();
        }

        return $data;
    }
858610
public function attributesToArray()
    {
        $attributes = parent::attributesToArray();

        foreach ($this->translatableAttributes as $translatableAttribute) {
            if (isset($attributes[$translatableAttribute])) {
                $attributes[$translatableAttribute] = $this->translate($translatableAttribute);
            }
            unset($attributes["{$translatableAttribute}_translation"]);
        }

        return $attributes;
    }
461552
public function toArray()
    {
        $data = [];

        foreach ($this->config as $key => $value) {
            if ($value instanceof self) {
                $value = $value->toArray();
            }

            $data[$key] = $value;
        }

        return $data;
    }
1080641
public function toArray()
    {
        $result = $this->getVisibleAttributes();
        $map    = $this->getMap();
        foreach ($map as $from => $to) {
            $result[$to] = $result[$from];
            unset($result[$from]);
        }

        return $result;
    }
899965
public function toArray()
    {
        $attributesToArray = [];
        foreach ($this->attributesToArray() as $attr => $value) {
            if (!starts_with($attr, '__i18n__')) {
                $attributesToArray[$attr] = $value;
            }
        }

        return array_merge($attributesToArray, $this->relationsToArray());
    }
1336289
public function toArray() : array
    {
        $output = [];
        foreach ($this->data as $key => $val) {
            $output[$key] = $val instanceof ArraySerializable ? $val->toArray() : $val;
        }
        return $output;
    }
563572
public function toArray()
    {
        $this->setHtmlAttribute('data-orderable', $this->isOrderable() ? 'true' : 'false');

        return [
            'attributes'  => $this->htmlAttributesToString(),
            'title'       => $this->getTitle(),
            'isOrderable' => $this->isOrderable(),
        ];
    }
203825
public function toArray()
    {
        $data = parent::toArray();

        foreach ($this->getComputedProperties() as $property)
        {
            if ($this->{$property} instanceof ModelEntityInterface) {
                $data[$property] = array_values($this->{$property}->toArray());
            } else {
                $data[$property] = $this->{$property};
            }
        }

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

        return $data;
    }
906320
public function toArray()
	{
		$list = parent::toArray();

		$list['attribute.domain'] = $this->getDomain();
		$list['attribute.code'] = $this->getCode();
		$list['attribute.status'] = $this->getStatus();
		$list['attribute.typeid'] = $this->getTypeId();
		$list['attribute.type'] = $this->getType();
		$list['attribute.position'] = $this->getPosition();
		$list['attribute.label'] = $this->getLabel();

		return $list;
	}
478837
public function toArray()
    {
        $result = [];

        if (!empty($this->name)) {
            $result['name'] = $this->name;
        }
        
        if (!empty($this->version)) {
            $result['version'] = $this->version->toArray();
        }

        if (isset($result['version']) && empty($result['version'])) {
            unset($result['version']);
        }

        return $result;
    }
1076522
public function toArray()
    {
        $properties = $this->properties;

        foreach ($properties as $name => $value) {
            if ($value instanceof Entity) {
                $properties[$name] = $value->toArray();
            }
        }

        return $properties;
    }
13145
public function toArray()
    {
        $ret = [ ];
        foreach ($this as $key => $value) {
            $ret[ $key ] = $value;
        }
        return $ret;
    }
533407
final public function toArray()
    {
        $this->checkRequiredFields();

        $fields = get_object_vars($this);

        $array = [];
        foreach ($fields as $field => $value) {
            $array[$field] = $this->transformToArray($this->getAttribute($field));
        }

        return $array;
    }
1321048
protected function getAttributes()
    {
        $attributes = [];
        $this->moveToFirstAttribute();

        do {
            $attributes[$this->name] = $this->value;
        } while ($this->moveToNextAttribute());

        return $attributes;
    }