public function deleteRouteGroup if this- User NULL this- setStatus PA

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public function deleteRouteGroup() {
if ($this->User === NULL) {
$this->setStatus("PAGE_NOT_FOUND");
return;
}
$rgm = Jams_Models_MapperFactory::getMapper('Jams_Models_UserRouteGroup', $this->conf);
if (isset ( $_POST ['id'] ) && ! empty ( $_POST ['id'] )) {
if (($rg = $rgm->getById ( $_POST ['id'] )) && ($rg->getLogin() == $this->User->getId())) {
try {
$rg->delete ();
} catch ( Exception $e ) {
$this->content = "error";
return;
}
$this->content = "ok"; // кушайте огурцi и помидорi ок
return;
}
}
$this->content = "error";
}