Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 /**
  * Retourne l'object db
  * @return type
  */
 private function db()
 {
     return \Origami\DB::get($this->_config->getDataBase());
 }
Ejemplo n.º 3
0
 /**
  * Efface un ou plusieurs modèle
  * @return boolean
  */
 public function delete()
 {
     return \Origami\DB::get($this->config->getDataBase())->delete($this->config->getTable());
 }