src/Entity/Factory/AbstractFactory.php
public function collection($listUp = null)
    {
        $collection = new $this->collectionName();
        if (!is_array($listUp)) {
            return $collection;
        }

        foreach ($listUp as $value) {
            $collection->add($this->entity($value));
        }

        return $collection;
    }
public function collection($listUp = null)
    {
        $collection = new $this->collectionName();
        if (!is_array($listUp)) {
            return $collection;
        }

        foreach ($listUp as $value) {
            $collection->add($this->entity($value));
        }

        return $collection;
    }
@param array $listUp

@return EntityCollection