Example #1
0
 /**
  * Adds the record to a list in the configured standard approach,
  * unless it should be (kept) excluded from any list.
  *
  * @param Model|Listify $model
  */
 protected function performConfiguredAddMethod(Model $model)
 {
     if (!$model->addNewAt() || $this->excludeFromList()) {
         return;
     }
     $addMethod = 'addToList' . $model->addNewAt();
     if (!method_exists($model, $addMethod)) {
         throw new \BadMethodCallException("Method '{$addMethod}' on listify model does not exist");
     }
     $model->{$addMethod}();
 }