Serialize object to array
@return array
173059
public function toArray()
	{
		return [
			'distance' => (float)$this->distance,
			'avgSpeed' => (float)$this->averageSpeed,
			'avgPace' => (float)$this->averagePace,
			'minAltitude' => (float)$this->minAltitude,
			'maxAltitude' => (float)$this->maxAltitude,
			'cumulativeElevationGain' => (float)$this->cumulativeElevationGain,
			'cumulativeElevationLoss' => (float)$this->cumulativeElevationLoss,
			'startedAt' => DateTimeHelper::formatDateTime($this->startedAt, phpGPX::$DATETIME_FORMAT, phpGPX::$DATETIME_TIMEZONE_OUTPUT),
			'finishedAt' => DateTimeHelper::formatDateTime($this->finishedAt, phpGPX::$DATETIME_FORMAT, phpGPX::$DATETIME_TIMEZONE_OUTPUT),
			'duration' => (float)$this->duration
		];
	}
711262
private function toArray()
    {
        $data = [];

        $reflection = new ReflectionClass($this);

        foreach ($reflection->getProperties() as $property) {
            $property->setAccessible(true);
            $data[$property->getName()] = $property->getValue($this);
        }

        return $data;
    }
1222475
public function toArray()
    {
        $out = [];
        foreach ($this as $key => $value) {
            $getter = sprintf('get%s', $key);
            if (!is_object($value) && method_exists($this, $getter)) {
                $out[$key] = call_user_func([$this, $getter]);
            }
        }

        return $out;
    }
757244
public function jsonSerialize()
    {
        $copy = [];
        foreach ((array)$this as $key => $value) {
            if (!is_string($value)) {
                $element = $value->getElement();
                if (is_object($element)
                    and method_exists($element, 'name')
                    and $name = $element->name()
                ) {
                    $copy[$name] = $value instanceof JsonSerializable ? $value->jsonSerialize() : $value;
                }
                $copy[$key] = $value instanceof JsonSerializable ? $value->jsonSerialize() : $value;
            } else {
                $copy[$key] = $value;
            }
        }
        return $copy;
    }
405538
public function toArray(): array
    {
        $groups = [];

        foreach ($this->groups as $group) {
            $key = Key::sanitize($group['name']);

            $key = sprintf('%s_%s', $this->parentKey, $key);

            $group = [
                'field' => sprintf('field_%s', Key::hash($key)),
                'operator' => $group['operator'],
                'value' => $group['value'],
            ];

            $groups[] = $group;
        }

        return $groups;
    }
849168
public function toArray(): array
    {
        $result = $this->orgData;
        foreach ($this->addAttributes as $key => $value) {
            $result[$key] = $value;
        }
        foreach ($this->updateAttributes as $key => $value) {
            $result[$key] = $value;
        }
        foreach ($this->removeAttributes as $key => $value) {
            unset($result[$key]);
        }
        return $result;
    }
470367
public function toArray()
    {
        return array_map(function($value) {
            if ($value instanceof Component) {
                return $value->json()->getAttributes();
            }

            return $value instanceof Arrayable ? $value->toArray() : $value;

        }, $this->items);
    }
777895
public function serialize()
    {
        $objectData = array();

        foreach ($this as $propertyName => $propertyValue)
        {
            if (    is_scalar($propertyValue)
                ||  is_array($propertyValue)
                ||  $propertyValue instanceof Serializable)
            {
                $objectData[$propertyName] = $propertyValue;
            }
        }

        return serialize($objectData);
    }
1094624
public function toArray()
    {
        $this->data->id = $this->id;

        return json_decode(json_encode($this->data), true);
    }
478120
public function jsonSerialize(): array
    {
        $returnArray = [];
        foreach ($this->getArrayCopy() as $value) {
            $returnArray[] = $value->JsonSerialize();
        }
        return $returnArray;
    }
1126217
public function toArray(): array
    {
        $payload = [
            'code' => $this->getCode()
        ];

        if (! empty($this->getMessage())) {
            $payload['message'] = $this->getMessage();
        }

        if (! empty($this->getError())) {
            $payload['error'] = $this->getError();
        }

        if (! empty($this->getData())) {
            $payload['data'] = $this->getData();
        }

        if (! empty($this->getOptions())) {
            $payload += $this->getOptions();
        }

        return $payload;
    }
497780
public function jsonSerialize()
    {
        $arr = parent::jsonSerialize();
        $vars = get_object_vars($this);
        return array_merge($vars, $arr);
    }
1149424
public function toArray()
    {
        return array(
            'e' => $this->entity,
            'r' => $this->reference,
            'v' => $this->value,
            'k' => $this->authorizationKey,
            's' => $this->status,
            't_key' => $this->key,
        );
    }
1135865
public function serialize(): array {
        // base 64 encode
        $details = array_map(function($value) {
            return base64_encode($value);
        }, $this->details);

        // enrich with encryption type
        return $details + ['encryption' => $this->encryption];
    }
328655
public function toArray(): array
    {
        return [
            'name' => $this->name,
            'method' => $this->method,
            'url' => $this->url,
            'model' => $this->model,
            'view' => $this->view,
            'controller' => $this->controller,
            'action' => $this->action,
            'default' => $this->default,
            'param' => $this->param,
            'callback' => $this->callback
        ];
    }
1336289
public function toArray() : array
    {
        $output = [];
        foreach ($this->data as $key => $val) {
            $output[$key] = $val instanceof ArraySerializable ? $val->toArray() : $val;
        }
        return $output;
    }
196490
public function jsonSerialize()
    {
        return [
            'count' => $this->count,
            'description' => $this->description,
            'group' => $this->group,
            'id' => $this->id,
            'meta' => $this->rejectHiddenMeta($this->meta),
            'parent_id' => $this->parent_id,
            'slug' => $this->slug,
            'taxonomy_id' => $this->taxonomy_id,
            'taxonomy_slug' => $this->taxonomy_slug,
            'title' => $this->title,
        ];
    }