class Model_UserPasswordResetRequest extends Orm\Model {
protected static $_table_name = 'user_pword_reset_requests';
protected static $_primary_key = array('hash');
protected static $_properties = array('hash', 'user_id', 'used', 'ipaddress', 'createdon');
public function _event_before_insert()
{
$this->createdon = \DB::expr('NOW()');
$this->ipaddress = Input::ip();
}
protected static $_observers = array('Orm\\Observer_Self' => array('events' => array('before_insert')));
}
$req = Model_UserPasswordResetRequest::forge(array(
'hash' => hash('sha256', $user->name . $user->email . $user->mobile . microtime()),
'user_id' => $user->id
));
$req->save();
It looks like you're new here. If you want to get involved, click one of these buttons!