diff --git a/application/Espo/ORM/EntityCollection.php b/application/Espo/ORM/EntityCollection.php index eb46a8fe99..5c2920700f 100644 --- a/application/Espo/ORM/EntityCollection.php +++ b/application/Espo/ORM/EntityCollection.php @@ -347,35 +347,20 @@ class EntityCollection implements Collection, Iterator, Countable, ArrayAccess, return false; } - /** - * @deprecated As of v6.0. Use `getValueMapList`. - * @todo Remove in v9.0. - * @return array>|stdClass[] - */ - public function toArray(bool $itemsAsObjects = false): array - { - $arr = []; - - foreach ($this as $entity) { - $item = $entity->getValueMap(); - - if (!$itemsAsObjects) { - $item = get_object_vars($item); - } - - $arr[] = $item; - } - - return $arr; - } - /** * {@inheritDoc} */ public function getValueMapList(): array { - /** @var stdClass[] */ - return $this->toArray(true); + $list = []; + + foreach ($this as $entity) { + $item = $entity->getValueMap(); + + $list[] = $item; + } + + return $list; } /** diff --git a/application/Espo/ORM/SthCollection.php b/application/Espo/ORM/SthCollection.php index 8119eabc62..2dc3e59b51 100644 --- a/application/Espo/ORM/SthCollection.php +++ b/application/Espo/ORM/SthCollection.php @@ -137,35 +137,18 @@ class SthCollection implements Collection, IteratorAggregate, Countable protected function prepareEntity(Entity $entity): void {} - /** - * @deprecated As of v6.0. Use `getValueMapList`. - * @todo Remove in v9.0. - * @return array>|stdClass[] - */ - public function toArray(bool $itemsAsObjects = false): array - { - $arr = []; - - foreach ($this as $entity) { - $item = $entity->getValueMap(); - - if (!$itemsAsObjects) { - $item = get_object_vars($item); - } - - $arr[] = $item; - } - - return $arr; - } - /** * {@inheritDoc} */ public function getValueMapList(): array { - /** @var stdClass[] */ - return $this->toArray(true); + $list = []; + + foreach ($this as $entity) { + $list[] = $entity->getValueMap();; + } + + return $list; } /**