public function update(array $data, array $identifier) { $today = new \DateTime(); $data['name'] = $this->parts[$data['weight']]; $data['updated_at'] = $today->format('Y-m-d H:i:s'); parent::update($data, $identifier); }
public function insert(array $data) { if (!isset($data['created_at'])) { $today = new \DateTime(); $data['created_at'] = $today->format('Y-m-d H:i:s'); } $data['updated_at'] = ''; parent::insert($data); }
public function insert(array $data) { if (!isset($data['created_at'])) { $today = new \DateTime(); $data['created_at'] = $today->format('Y-m-d H:i:s'); } $data['updated_at'] = ''; $data['confirmation_token'] = $this->createHash(); return parent::insert($data); }