public function add() { \Origami\DB::get('test')->trans_start(); $user = new \Entity\test\user(); $user->firstname = 'John'; $user->lastname = 'Do'; $user->password = sha1('JohnDo'); $user->birth = new DateTime('17-04-1984'); $user->dateinsert = new DateTime(); $user->dateupdate = new DateTime(); $user->save(); \Origami\DB::get('test')->trans_complete(); return \Origami\DB::get('test')->trans_status(); }
/** * Retourne l'object db * @return type */ private function db() { return \Origami\DB::get($this->_config->getDataBase()); }
/** * Efface un ou plusieurs modèle * @return boolean */ public function delete() { return \Origami\DB::get($this->config->getDataBase())->delete($this->config->getTable()); }