bleu
(Zend W)
1
I want to increase a model attribute value by 1. The attribute value is int in database
$aaa=$model->aaa;
$model->aaa =$aaa - 1 ; or to increase I will use $model->aaa =$aaa + 1 ;
$model->save();
It is not working.
Can I know what is wrong?
sensorario
(Sensorario)
2
You want to increase (+1) but your code is ($aaa-1). Is this wrong?
bleu
(Zend W)
3
Sorry about that I want to increase and decrease certain parts, I thought if I can find the increase one I can do the descrease one also?
mdomba
(Maurizio Domba Cerin)
4
bleu
(Zend W)
5
How will I decrease here?
mdomba
(Maurizio Domba Cerin)
6
The documentation is very clear…
To decrease:
$model->updateCounters(array('aaa' => -1), '<yourcondition>');