this method returns an array

@return array
962008
public function buildArray()
    {
        // Initialization
        $query = ProductQuery::create();
        $this->country = Country::getShopLocation();
        $this->calculator = new Calculator();
        $this->currencies = CurrencyQuery::create()->find();
        $this->locales = $this->getExistingLocales();

        // Loop application
        if (BooleanOrBothType::ANY !== $visible = $this->getVisible()) {
            $query->filterByVisible($visible);
        }

        $limit = $this->getLimit();

        // Array building
        $results = [];

        /** @var \Thelia\Model\Product $product */
        foreach ($query->find() as $i => $product) {
            if ($i >= $limit) {
                break;
            }

            $row = &$results[];
            $productPrices = [];

            // Add descriptive
            foreach ($this->locales as $locale) {
                $translation = $product->getTranslation($locale);

                $row["url_".$locale] = $product->getUrl($locale);
                $row["title_".$locale] =  $translation->getTitle();
                $row["description_".$locale] =  $translation->getDescription();
            }

            $row["id"] = $product->getId();
            $row["ref"] = $product->getRef();

            $row["attribute"] = "";
            $row["attribute_av"] = "";

            // Handle PSE / price information
            /** @var \Thelia\Model\ProductSaleElements $pse */
            foreach ($product->getProductSaleElementss() as $pse) {
                $this->handleProductSaleElements($row, $productPrices, $pse);
            }

            foreach ($productPrices as $currencyCode => $productPrice) {
                $row["price_".$currencyCode] = $productPrice;
            }

            // Them add image url
            $image = ProductImageQuery::create()
                ->filterByProduct($product)
                ->orderByPosition()
                ->findOne()
            ;

            if (null !== $image) {
                $event = new ImageEvent();
                $width = $this->getWidth();
                $height = $this->getHeight();

                if (! is_null($width)) {
                    $event->setWidth($width);
                }
                if (! is_null($height)) {
                    $event->setHeight($height);
                }

                $sourceFilePath = sprintf(
                    "%s%s/%s/%s",
                    THELIA_ROOT,
                    ConfigQuery::read('images_library_path', 'local'.DS.'media'.DS.'images'),
                    "product",
                    $image->getFile()
                );

                $event->setSourceFilepath($sourceFilePath);
                $event->setCacheSubdirectory("product");

                $this->container->get("event_dispatcher")->dispatch(TheliaEvents::IMAGE_PROCESS, $event);

                $row["image_url"] = $event->getFileUrl();
            } else {
                $row["image_url"] = null;
            }
        }

        return $results;
    }
640600
public function toArray()
    {
        return array(
            'scheme' => $this->scheme->get(),
            'user' => $this->user->get(),
            'pass' => $this->pass->get(),
            'host' => $this->host->get(),
            'port' => $this->port->get(),
            'path' => $this->path->get(),
            'query' => $this->query->get(),
            'fragment' => $this->fragment->get(),
        );
    }
1336289
public function toArray() : array
    {
        $output = [];
        foreach ($this->data as $key => $val) {
            $output[$key] = $val instanceof ArraySerializable ? $val->toArray() : $val;
        }
        return $output;
    }
590241
public function toArray()
  {
    $return = [];
    foreach ( $this as $property => $value ) {
      if ( '__' == substr( $property, 0, 2 ) || '' === $value || is_null( $value ) || ( is_array( $value ) && empty( $value ) ) ) {
        continue;
      }

      if ( in_array( $property, $this->functions ) && substr( $value, 0, 8 ) == 'function' ) {
        $value = "%{$property}%";
      }

      $return[ $property ] = $value;
    }

    return $return;
  }
1370103
public function toArray(): array
	{
		$results = [];

		foreach($this->items as $item)
		{
			$results[] = $item->toArray();
		}

		return $results;
	}
909912
public function toArray()
    {
        return [
            'type'     => get_class($this),
            'value'    => $this->getValue(),
            'children' => array_map(function ($node) {
                return $node->jsonSerialize();
            }, $this->getChildren()),
        ];
    }
735583
public function toArray()
    {
        return [
            'id'          => $this->id,
            'module'      => $this->module,
            'bundle'      => $this->bundle,
            'position'    => $this->position,
            'name'        => $this->name,
            'description' => $this->description,
            'category'    => $this->category,
            'active'      => $this->active,
            'tags'        => $this->tags
        ];
    }
552216
public function toArray()
    {
        $arrayResult = array();
        for ($i = 0; $i < $this->length(); ++$i) {
            if ($this->offsetExists($i)) {
                $arrayResult[] = $this->offsetGet($i)->toArray();
            }
        }

        return $arrayResult;
    }
72913
public function toArray() {
        $result = [];
        $count  = count($this->elements);
        for ($i=0;$i<$count;$i++) {
            $result[] = $this->elements[$i];
        }
        return $result;
    }
427522
public function toArray()
    {
        return [
            'name' => $this->getName(),
            'text' => $this->getText(),
            'style' => $this->getStyle(),
            'type' => $this->getType(),
            'value' => $this->getValue(),
            'confirm' => $this->getConfirm()->toArray(),
        ];
    }
13145
public function toArray()
    {
        $ret = [ ];
        foreach ($this as $key => $value) {
            $ret[ $key ] = $value;
        }
        return $ret;
    }
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;
	}
68779
public function toArray() : array
    {
        $result = [];

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

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

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

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

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

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

        if (!empty($this->source)) {
            $result['source'] = $this->source->map(function ($item) {
                return $item;
            });
        }

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

        if (!empty($this->exception)) {
            $e = $this->exception;
            if ($e instanceof ExtendedLoggingInformation) {
                $result['exception'] = $e->context();
            } else {
                $result['exception'] = [
                    'exception' => get_class($e),
                    'message' => $e->getMessage(),
                    'stacktrace' => $e->getTrace(),
                ];
            }
        }

        return $result;
    }
1362045
public function toArray()
    {
        return [
            'folderId' => $this->folder->getId(),
            'usageType' => $this->usageType,
            'usageId' => $this->usageId,
            'status' => $this->status,
        ];
    }
190621
public function toArray()
    {
        $ret = array();
        foreach (array_keys($this->values) as $key) {
            $ret[$key] = $this->get($key);
        }

        return $ret;
    }
1264181
public function toArray()
        {
            return [
                'tag' => $this->tag,
                'void' => $this->void,
                'attributes' => $this->attributes,
                'content' => $this->recursivelyArrayify($this->content)
            ];
        }
584026
public function toArray()
    {
        return [
            $this->id,
            $this->filterName,
            $this->operator,
            serialize($this->value),
        ];
    }