LeanMapper\Repository::createEntity PHP Метод

createEntity() защищенный Метод

Creates new Entity instance from given \Dibi\Row instance
protected createEntity ( Row $dibiRow, string | null $entityClass = null, string | null $table = null ) : mixed
$dibiRow Dibi\Row
$entityClass string | null
$table string | null
Результат mixed
    protected function createEntity(DibiRow $dibiRow, $entityClass = null, $table = null)
    {
        if ($table === null) {
            $table = $this->getTable();
        }
        $result = Result::createInstance($dibiRow, $table, $this->connection, $this->mapper);
        $primaryKey = $this->mapper->getPrimaryKey($table);
        $row = $result->getRow($dibiRow->{$primaryKey});
        if ($entityClass === null) {
            $entityClass = $this->mapper->getEntityClass($table, $row);
        }
        $entity = $this->entityFactory->createEntity($entityClass, $row);
        $entity->makeAlive($this->entityFactory);
        return $entity;
    }