private function createNewEvent($email, $password, $title, $venue, $privacy, $fees, $currency_country = "") { $response = array(); $response["success"] = 0; //verify if the user exists $trycheck = new TryUserLogin($email, $password); if ($trycheck->isExists()) { $tryfetch = new TryFetchUser(); $user = $tryfetch->fetch($email); if ($user != null) { $user_json = json_encode($user); $user_php = json_decode($user_json); $event = new Event($user_php->ID, $title, $venue, $privacy); $event->setCreateDate(Validator::Now()); $event->setDuration(""); $event->setStartDate(""); $event->setDescription(""); $event->setFees($fees); $event->setCurrencyCountry($currency_country); // $event->setSearchableKeywords($searchable); //validate the events if ($this->validate($event)) { $response = $this->commit($event); } else { $response["error_message"] = $this->__message; } } } else { $response["success"] = 0; $response["error_message"] = "relogin into your account , user session expired"; } $jsonView = new JsonViewer(); $jsonView->setContent($response); return $jsonView; }
private function parserEventJson($jsonevent) { $event = null; //convert to php object $php_object = json_decode($jsonevent); if ($php_object != null) { $event = new Event($php_object->CreatorId, $php_object->Title, $php_object->Venue, $php_object->privacy); $event->setCurrencyCountry($php_object->current_country); $event->setSearchableKeywords($php_object->search_keywords); $event->setFees($php_object->fees); $event->setCurrencyCountry($php_object->current_country); $event->setCurrencyCountry($php_object->current_country); $event->setDescription($php_object->Description); $event->setStartDate($php_object->StartDate); $event->setGoing($php_object->going); } return $event; }