getName() public method

public getName ( ) : string
return string
Exemplo n.º 1
0
 public function addAction()
 {
     $success = false;
     $code = Qrcode\Config::getByName($this->getParam("name"));
     if (!$code) {
         $code = new Qrcode\Config();
         $code->setName($this->getParam("name"));
         $code->save();
         $success = true;
     }
     $this->_helper->json(array("success" => $success, "id" => $code->getName()));
 }
Exemplo n.º 2
0
 public function addAction()
 {
     try {
         Qrcode\Config::getByName($this->getParam("name"));
         $alreadyExist = true;
     } catch (\Exception $e) {
         $alreadyExist = false;
     }
     if (!$alreadyExist) {
         $code = new Qrcode\Config();
         $code->setName($this->getParam("name"));
         $code->save();
     }
     $this->_helper->json(array("success" => !$alreadyExist, "id" => $code->getName()));
 }