public function findOneBy(array $criteria = [], array $orders = [], $offset = null): ?AbstractEntity
    {
        $array = $this->findBy($criteria, $orders, 1, $offset);

        return array_shift($array);
    }
public function findOneBy(array $criteria = [], array $orders = [], $offset = null): ?AbstractEntity
    {
        $array = $this->findBy($criteria, $orders, 1, $offset);

        return array_shift($array);
    }
public function findOneBy ( array $ criteria = [ ] , array $ orders = [ ] , $ offset = null ) : ? AbstractEntity { $ array = $ this -> findBy ( $ criteria , $ orders , 1 , $ offset ) ; return array_shift ( $ array ) ; }
Finds one entity from criteria

@param array $criteria
@param array $orders
@param null  $offset

@return AbstractEntity
Finds one entity from criteria