Example #1
0
 public function add()
 {
     if ($this->validate()) {
         $feature = new Features();
         $feature->name = $this->feature_name;
         $feature->feature_type = $this->feature_type;
         if ($feature->feature_type == Features::VALUE_TYPE) {
             $this->feature_metric_id = null;
         }
         $feature->feature_metric_id = $this->feature_metric_id;
         return $feature->save();
     }
     return false;
 }