I am trying to use the beforeSave function to create an expiration date 30
days from creation time.
function beforeSave() {
if(!empty($this->data['Ticket']['user_id'])) {
$this->data['Ticket']['expires'] =
$this->expiresDate($this->data['Ticket']['created']);
}
return true;
}
function expiresDate($dateString) {
$future = strtotime('+30 days', $dateString);
return date('Y-m-d', strtotime($future));
}
But its not doing anything.
Is there something missing or wrong here?
Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---