Example #1
0
 public function delete()
 {
     $user = $this->getObject();
     try {
         $u = new Agana_Persist_Dao_Object();
         return $u->delete($this->_object->getId());
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #2
0
 /**
  * Creates a new object in persistence and return it
  * 
  * @param String table name
  * @return Agana_Model_Object
  */
 public static function create($table)
 {
     if (isset($table)) {
         $o = new Agana_Model_Object(null);
         $o->setTableName($table);
         $od = new Agana_Domain_Object($o);
         return $od->add();
     } else {
         throw new Agana_Exception('Object table name should not be null');
     }
 }
Example #3
0
 /**
  * Prepare data for return from a persistent search
  *
  * @param array
  * @return Agana_Model_Object
  */
 private function _prepareReturnData($data)
 {
     $o = new Agana_Model_Object($data);
     $o->setId($data['objid']);
     $o->setTableName($data['tablename']);
     return $o;
 }