collection = $collection; $this->total = $total; } /** * Get a total number of records in DB (that matches applied search parameters). */ public function getTotal(): ?int { return $this->total; } /** * Get an ORM collection. */ public function getCollection(): OrmCollection { return $this->collection; } /** * Get a value map list. * * @return stdClass[] */ public function getValueMapList(): array { if ( $this->collection instanceof EntityCollection && !$this->collection->getEntityType() ) { $list = []; foreach ($this->collection as $e) { $item = $e->getValueMap(); $item->_scope = $e->getEntityType(); $list[] = $item; } return $list; } return $this->collection->getValueMapList(); } }