#6499: UpdateAll() - string quoting problems, and model alias inconsistencies
-+--
Reporter: kunalpunjabi | Type: Bug
Status: new | Priority: Medium
Milestone: 1.2.x.x | Component: Model
Version: 1.2 Final | Severity: Major
Keywords:| Php_version: PHP 5
Cake_version:|
-+--
nate: youve closed another ticket on this i believe, but there are folks
on the channel that agree with me in that updateAll() needs to be
consistent with Save(). I spent 2 hours figuring this out!
Please see the discussion below
xkunalxStoosh: therea are 3 problems with this api, based on my
past 2 hrs of desperate attempts
Stooshwhich are
xkunalx 1. the update fields dont accept model aliases
xkunalx 2. the conditions array does...in my case it needs it
xkunalx 3. quoting the fields needs to be done manually
xkunalx the cookbook also seems to quote them. i just noticed that
now
xkunalx http://book.cakephp.org/view/75/Saving-Your-Data
This is my working snippet of code
$dt = date('Y-m-d H:i:s', time());
$this-Invoice-User-updateAll( array(
'plan_id' = $trial_plan_id,
'trial_invoked' = '$dt',
'trial_endtime' =
'$trial_endtime',
),
array('trial_invoked' = NULL)
);
This is what I should be allowed to do:
$dt = date('Y-m-d H:i:s', time());
$this-Invoice-User-updateAll( array(
'User.plan_id' = $trial_plan_id,
'User.trial_invoked' = '$dt',
'User.trial_endtime' =
'$trial_endtime',
),
array('User.trial_invoked' =
NULL)
);
--
Ticket URL: https://trac.cakephp.org/ticket/6499
CakePHP : The Rapid Development Framework for PHP https://trac.cakephp.org/
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
tickets cakephp group.
To post to this group, send email to tickets-cakephp@googlegroups.com
To unsubscribe from this group, send email to
tickets-cakephp+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~--~~~~--~~--~--~---