Consult single registry by zend framework

Asked

Viewed 13 times

-2

I have a notafiscal table that has a field numerosefaz

this field is not autoincrement, so to add the next one, I have to fetch the last added item

I am using the code below...

But I think the correct one would not be fetchAll. Have some command that I can search for more directly since it is a single record?

    $select = $this->getDbTable()->select()
         ->from('notafiscal', 'numerosefaz')                  
         ->order('numerosefaz DESC')
         ->limit(1)
            ;
           
    $resultado = $this->getDbTable()->fetchAll($select);                
   var_dump($resultado[0]['numerosefaz']);exit;
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.