dg / dibi

Dibi - smart database abstraction layer
https://dibiphp.com
Other
487 stars 136 forks source link

fetch to return NULL instead of FALSE #266

Closed dakorpar closed 7 years ago

dakorpar commented 7 years ago

Description

It would be nice if fetch function returns NULL when nothing is found instead of FALSE. It's breaking change so that's why I'm not creating PR but creating issue instead. I think it would be usefull becaue then it would be possible to set in result directly to ?TableEntity

for example:

public function getUser($id) : ?UserEntity
{
             $result $this->dibi->select('*')
            ->from('users')
            ->where('id=%i', $id)
            ->execute()
            ->setRowClass(UserEntity::class)
            ->fetch();
            return $result
}
dg commented 7 years ago

7d42317279c4cdbd6936d647bc44bf71484d4a97