public static function sandbox()
 {
     // Testaa koodiasi täällä
     $Sven = new Hero(array('name' => 's', 'primaryattribute' => 'jäbäys', 'damagetype' => 'Physical', 'primaryrole' => 'core', 'attacktype' => 'Melee'));
     $errors = $Sven->errors();
     Kint::dump($errors);
 }
 public static function update($id)
 {
     self::check_logged_in();
     $params = $_POST;
     $attributes = array('id' => $id, 'name' => $params['name'], 'primaryattribute' => $params['primaryattribute'], 'damagetype' => $params['damagetype'], 'attacktype' => $params['attacktype'], 'primaryrole' => $params['primaryrole'], 'description' => $params['description']);
     $hero = new Hero($attributes);
     $errors = $hero->errors();
     if (count($errors) > 0) {
         View::make('hero/edit.html', array('errors' => $errors, 'attributes' => $attributes));
     } else {
         $hero->update();
         Redirect::to('/hero/' . $hero->id, array('message' => 'Heroa on muokattu onnistuneesti!'));
     }
 }