fromId() public static method

Initiliaze from id
public static fromId ( integer $id ) : boolean | Model
$id integer Event id
return boolean | Model
Example #1
-1
 /**
  * Remove event
  *
  * @return JsonModel
  */
 public function removeEventAction()
 {
     $model = Event\Model::fromId($this->params()->fromRoute('id'));
     $success = false;
     if (!empty($model)) {
         $model->delete();
         $success = true;
     }
     $jsonModel = new JsonModel();
     $jsonModel->setVariables(array('success' => $success));
     $jsonModel->setTerminal(true);
     return $jsonModel;
 }