mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 23:16:03 +00:00
deprecation removal
This commit is contained in:
@@ -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<array<string, mixed>>|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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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<int, array<string, mixed>>|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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user