php - Symfony Expiration Time Calculation -
insymfony (doctrine) trying create public function code below. i'm trying when user submits form, calculated expiration date item. here code have far don't know how calculate current time. have taken pieces of code different examples have found on internet fails every time.
class car extends basecar { public function save(doctrine_connection $conn = null) { if ($this->isnew() && ! $this->getendtime()) { $now = need $this->setendtime(date('y-m-d h:i:s', $now + 86400 * sfconfig::get('item_duration'))); } return parent::save($conn); } }
the item_duration
set in app.yml
file. can set site wide variable.
you can current time this.
$now = time();
Comments
Post a Comment