Example #1
0
File: Step1.php Project: ninetor/23
 /**
  * @return bool|string
  */
 public function addGift()
 {
     if ($this->validate()) {
         $gift = new Gift();
         $gift->setAttributes($this->getAttributes());
         $gift->validation_code = $this->_setValidationCode();
         if ($gift->save()) {
             $gift->sendValidationCode();
             return $gift->id;
         }
     } else {
         return $this->getErrors();
     }
 }