toArray

@param array $ignore

@return array
191777
public function toArray($ignore = ['site'])
    {
        $array = parent::toArray($ignore);
        if (!in_array('siteId', $ignore)) {
            $array['siteId'] = $this->getSiteId();
        }

        // @bc support
        if (!in_array('domain', $ignore)) {
            $site = $this->site;
            if ($site !== null) {
                $array['domain'] = $site->getDomain()->getDomainName();
            }
        }

        if (!in_array('domainName', $ignore)) {
            $site = $this->site;
            if ($site !== null) {
                $array['domainName'] = $site->getDomain()->getDomainName();
            }
        }

        return $array;
    }
981694
public function toArray($simplify = false): array
    {
        $r = [];
        foreach ($this as $key => $val) {
            $r[$key] = $val;
        }
        if ($simplify) {
            $r = array_filter($r);
        }

        return $r;
    }
790541
public function toArray($ignore = ['pluginWrappers'])
    {
        $data = parent::toArray($ignore);
        if (!in_array('pluginWrappers', $ignore)) {
            $data['pluginWrappers'] = $this->modelArrayToArray(
                $this->getPluginWrappers()->toArray(),
                []
            );
        }

        if (!in_array('createdDateString', $ignore)) {
            $data['createdDateString'] = $this->getCreatedDateString();
        }

        if (!in_array('publishedDateString', $ignore)) {
            $data['publishedDateString'] = $this->getPublishedDateString();
        }

        return $data;
    }
1153987
public function toArray($ignoreEmpty = false)
    {
        if (!$ignoreEmpty) {
            return $this->data;
        }

        return array_filter(
            $this->data,
            function ($value) {
                return !empty($value);
            }
        );
    }
1265363
public function toArray(): array
    {
        return array_map(function ($value) {
            if (method_exists($value, 'toArray')) {
                return $value->toArray();
            }

            return $value;
        }, $this->items);
    }
1068154
public function toArray()
    {
        $array = [];

        foreach ($this->items as $key => $value) {
            if ($value instanceof ExportableInterface) {
                $array[$key] = $value->toArray();
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
1122567
public function toArray(array $allowed = null)
	{
		if ( ! $this->_toArray() || $this->isModified())
		{
			$response = $this->client->send((new Request($this->uri->withPath($this->uri->getPath().'trash/resources')
			                                                       ->withQuery(http_build_query(array_merge($this->getParameters($this->parametersAllowed), [
					'path' => $this->getPath()
				]), null, '&')), 'GET')));

			if ($response->getStatusCode() == 200)
			{
				$response = json_decode($response->getBody(), true);

				if ( ! empty($response))
				{
					$this->isModified = false;

					if (isset($response['_embedded']))
					{
						$response = array_merge($response, $response['_embedded']);
					}

					unset($response['_links'], $response['_embedded']);

					if (isset($response['items']))
					{
						$response['items'] = new Container\Collection(array_map(function($item) {
							return new self($item, $this->client, $this->uri);
						}, $response['items']));
					}
					
					$this->setContents($response);
				}
			}
		}

		return $this->_toArray($allowed);
	}
196944
public function toArray()
    {
        return [
            'platform'        => $this->platform,
            'environment'     => $this->environment,
            'version'         => $this->version,
            'majorVersion'    => $this->majorVersion,
            'minorVersion'    => $this->minorVersion,
            'patchVersion'    => $this->patchVersion,
            'deviceOsVersion' => $this->deviceOsVersion,
            'device'          => $this->device,
        ];
    }
644429
public function toArray() : array {
        return [
            'command'   => $this->getCommand(),
            'running'   => $this->isRunning(),
            'info'      => $this->getInfo() ? $this->getInfo()->toArray() : null,
        ];
    }
403512
public function toArray($ignore = [])
    {
        return [
            'siteId' => $this->getSiteId(),
            'pageId' => $this->getPageId(),
            'name' => $this->getName(),
            'author' => $this->getAuthor(),
            'createdDate' => $this->getCreatedDateString(\DateTime::ISO8601),
            'lastPublished' => $this->getLastPublishedString(\DateTime::ISO8601),
            'pageLayout' => $this->getPageLayout(),
            'siteLayoutOverride' => $this->getSiteLayoutOverride(),
            'pageTitle' => $this->getPageTitle(),
            'description' => $this->getDescription(),
            'keywords' => $this->getKeywords(),
            'pageType' => $this->getPageType(),
        ];
    }
815498
public function toArray()
    {
        $result = [];

        if (!empty($this->name) && empty($this->version)) {
            return $this->name;
        }

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

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

        return $result;
    }
675357
public function toArray($plain = false)
    {
        $result = array();

        foreach ($this as $key => $value) {
            if ($plain) {
                $result[] = $value->toArray();
            } else {
                $result[] = $this->connection->unmarshall($value);
            }
        }

        return $result;
    }
303427
public function toArray()
    {
        $array = [];
        $transform = function ($letters) {
            $letter = array_shift($letters);

            return '_' . strtolower($letter);
        };
        foreach ($this as $key => $value) {
            if ($key === '__strictMode__') {
                continue;
            }
            $normalizedKey = preg_replace_callback('/([A-Z])/', $transform, $key);
            $array[$normalizedKey] = $value;
        }

        return $array;
    }
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;
    }
781544
public function toArray($protect = null)
    {
        $protect = is_array($protect)
            ? $protect
            : $this->_protect;

        if ($protect) {
            $new = $this->_params;


            foreach ($protect as $key) {
                unset($new[$key]);
            }

            // Do json encode and decode to convert all levels to arrays
            return json_decode(json_encode($new), true, 512);
        }

        // Do json encode and decode to convert all levels to arrays
        return json_decode(json_encode($this->_params), true, 512);
    }
1049930
public function collectionToArray($collection, $title = 'title')
     {
         $array = array();
         foreach ($collection as $item) {
             $getter = 'get'.ucfirst($title);
             $array[$item->getId()] = $item->$getter();
         }

         return $array;
     }
310102
public function toArray(array $data = [])
    {
        return array_filter(array_merge([
            'start' => $this->start,
            'range' => $this->range,
            'sort' => $this->sort,
            'sortDir' => $this->sortDirection,
            'search' => $this->search,
            'searchNotes' => $this->searchNotes,
            'condition' => $this->condition ? json_encode($this->condition) : null
        ], $data), function ($value) {
            return $value !== null;
        });
    }