for update

Hello guys,

in phalcon 1.3.3 is added for update functionality. But I getting this error:

Syntax error, unexpected token IDENTIFIER(FOR), near to ' UPDATE', when parsing: SELECT [InvoicePayment].* FROM [InvoicePayment] WHERE id = :id: AND [invoice_id] = ?0 FOR UPDATE (96)
#0 [internal function]: Phalcon\Mvc\Model\Query->parse() 
#1 [internal function]: Phalcon\Mvc\Model\Query->execute(Array, NULL) 
...

My code:

$regularPayment = $this->_getInvoice()->getInvoicePayment([
                        'id = :id:',
                        'bind' => [
                            'id' => $key
                        ],
                        'for_update' => true
                    ]);

Are you tried forupdate in Phalcon 1.3.3 ? And how about sharedlock? Is it added too?



83.4k

It seems PHQL is not supporting that syntax, maybe it a further release it will be added.