示例#1
0
 /**
  * Delete the object and its aggregates
  * @param $id object ID
  */
 public function delete($id = NULL)
 {
     // delete the related System_userSystem_user_grupo objects
     $id = isset($id) ? $id : $this->id;
     $repository = new TRepository('UsuarioGrupo');
     $criteria = new TCriteria();
     $criteria->add(new TFilter('usuario_id', '=', $id));
     $repository->delete($criteria);
     // delete the related System_userSystem_user_program objects
     $id = isset($id) ? $id : $this->id;
     $repository = new TRepository('UsuarioFuncionalidade');
     $criteria = new TCriteria();
     $criteria->add(new TFilter('usuario_id', '=', $id));
     $repository->delete($criteria);
     // delete the object itself
     parent::delete($id);
 }
示例#2
0
 /**
  * Constructor method
  */
 public function __construct($id = NULL, $callObjectLoad = TRUE)
 {
     parent::__construct($id, $callObjectLoad);
     parent::addAttribute('descricao');
 }
示例#3
0
 /**
  * Fill the Active Record properties from another Active Record
  * @param $object An Active Record
  */
 public function mergeObject(TRecord $object)
 {
     $data = $object->toArray();
     foreach ($data as $key => $value) {
         $this->data[$key] = $value;
     }
 }