Friday, July 18, 2014

Re: How to calculate in array from $this->model->updateAll()?

 'CmsPage.rgt' => 'CmsPage.rgt + 2'

On Thursday, July 17, 2014 11:15:48 PM UTC+2, Sam Clauw wrote:
I try to do an "update all" in my add action with the following method:

$this->CmsPage->updateAll(
    array(
        'CmsPage.rgt' => ('CmsPage.rgt' + 2)
    ),
    array(
        'CmsPage.rgt >' => $right
    )
);

Unfortunately, i'ts not working. It keeps sending the value "2" to the rgt field in my database table.
So my question is: what's should be changed in my array (2 + 'CmsPage.rgt) to do such calculations? :)

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: