_model === null) { $modelClass = $this->getModelClass(); $this->_model = new $modelClass(); // $this->_model->setDebug(true); } return $this->_model; } final public function getEntity(): mixed { $result = $this->getModel()->getResult(); if (!$result) { //결과값이 없으면 null return $result; } $entityClass = $this->getEntityClass(); return new $entityClass($result); } final public function getEntitys(): array { $entitys = []; foreach ($this->getModel()->getResults() as $result) { $entityClass = $this->getEntityClass(); $entitys[] = new $entityClass($result); } return $entitys; } // final public function getCount(): int { $count = $this->getModel()->countAllResults(); // echo "
" . $this->getModel()->getLastQuery(); return $count; } } //Class