public function executeAddregion() { $c = new Criteria(); $c->add(RegionPeer::NAME, $this->getRequestParameter('region')); $exregion = RegionPeer::doSelectOne($c); if ($exregion) { $this->setFlash('notice', 'Region could not be added. A Region with this name already exists.'); } else { $region = new Region(); $region->setName($this->getRequestParameter('region')); $region->save(); $this->setFlash('notice', 'Region <b>' . $region->getName() . '</b> added successfully'); } $this->redirect('admin/regions'); }