public static function getById($id) { $visitor = new Resource(); $visitor->setId($id); self::loadByID($visitor); return $visitor; }
public function postNew() { $university = filter_input(INPUT_POST, 'university', FILTER_SANITIZE_STRING); $mascot = filter_input(INPUT_POST, 'mascot', FILTER_SANITIZE_STRING); $visitor = new \tailgate\Resource\Visitor(); $visitor->setUniversity($university); $visitor->setMascot($mascot); self::saveResource($visitor); }