Please read what I wrote :-)

If you set Modified in your data array then the value you set will be
saved and will not be inserted automagically  - some of the relevant
lines from Save method of modle.php are

foreach (array('created', 'updated', 'modified') as $field) {
        if (array_key_exists($field, $v) && empty($v[$field])) {
                        unset($v[$field]);
        }
}


Got it?

You are right in saying that you never need to set the modified in
most cases but this is no "most cases"

Cheers
Tarique


On Tue, Feb 15, 2011 at 12:25 PM, Jeremy Burns | Class Outfit
<[email protected]> wrote:
> That isn't so; I never set modified in the data array. It is set in 
> /cake/libs/model.php
>
> I know that doesn't answer the question, but this is not the right direction.
>
> My initial thought is to create a class that extends Model that includes a 
> custom save function that does not set modified. How you make that trigger on 
> a reorder only is beyond me at this point. Someone far more experienced than 
> me give some better advice.
>
> Jeremy Burns
> Class Outfit
>
> [email protected]
> http://www.classoutfit.com
>
> On 15 Feb 2011, at 05:25, Dr. Tarique Sani wrote:
>
>> If modified is set in your Data then that value will be saved in the database
>>
>> Rest I leave you to figure out ;-)
>>
>> Cheers
>> Tarique
>>
>> On Tue, Feb 15, 2011 at 10:32 AM, Krissy Masters
>> <[email protected]> wrote:
>>> Does anyone know if it is possible to not auto save the Modified field?
>>>
>>> I am doing a drag / drop re-order and this updates each records" order"
>>> field therefor editing the modified timestamp.
>>> Might confuse the end user since the average person will not think they
>>> actually edited the record yet every record now says Modified 10 mins ago.
>>>
>>> function _reOrder($currentModel, $order) {
>>>
>>>        $count = -1;//count will start at zero
>>>        foreach ( $order as $k => $v ) {
>>>                $count++;
>>>                $this->$currentModel->id = $v;
>>>                $this->$currentModel->saveField('order', $count);
>>>
>>>        }
>>> }
>>>
>>> Thanks,
>>>
>>> K
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials 
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>>> others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> [email protected] For more options, visit this group at 
>>> http://groups.google.com/group/cake-php
>>>
>>
>>
>>
>> --
>> =============================================================
>> PHP for E-Biz: http://sanisoft.com
>> =============================================================
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> [email protected] For more options, visit this group at 
>> http://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/cake-php
>



-- 
=============================================================
PHP for E-Biz: http://sanisoft.com
=============================================================

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to