Example #1
0
 protected function createEvent()
 {
     $event = new Event();
     $event->setTitle('Test Event #1');
     $event->setStartDate('2010-06-01');
     return $event;
 }
 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;
 }
 public function load(ObjectManager $manager)
 {
     $testEvent = new Event();
     $testEvent->setStartDate(date("d/m/Y"));
     $testEvent->setName('TestEvent');
     //$testEvent->setOwner('James');
     $manager->persist($testEvent);
     $manager->flush();
     $this->addReference('test-event', $testEvent);
 }
Example #4
0
    } else {
        $response["error"] = 1;
        $response["error_message"] = "Invalid ID,Expecting numeric ID";
    }
    print json_encode($response);
});
$app->put('/event/:id', function ($id) use($app, $eventMapper) {
    verifyRequiredParams(array('id', 'logo'));
    $event = new Event();
    $event->setId($id);
    $event->setName($app->request()->put('name'));
    $event->setDetails($app->request()->put('details'));
    $event->setSlogan($app->request()->put('slogan'));
    $event->setCategory($app->request()->put('type'));
    $event->setRules($app->request()->put('rules'));
    $event->setStartDate($app->request()->put('start_date'));
    $event->setEndDate($app->request()->put('end_date'));
    $event->setStartTime($app->request()->put('start_time'));
    $event->setEndTime($app->request()->put('end_time'));
    $event->setGroupSize($app->request()->put('group_size'));
    $event->setLogo($app->request()->put('logo'));
    # --Getting the put vars and typecasting to int. Blehhh. Can't help, its PHP xD
    $feeHome = $app->request()->put('fee_home');
    settype($feeHome, "integer");
    $feeRemote = $app->request()->put('fee_remote');
    settype($feeRemote, "integer");
    #--
    $event->setFeeHome($feeHome);
    $event->setFeeRemote($feeRemote);
    $event->setLocation($app->request()->put('location'));
    $event->setEventHeadName($app->request()->put('event_head_name'));
Example #5
0
 public function testPopulateReverseOneToOne()
 {
     $event = new Event();
     $event->setTitle('Test Event');
     $event->setStartDate('today');
     $event->populateEventSlot();
     $event->populateEventDetail();
     $event->store();
 }
Example #6
0
 public function testDeleteForceCascadeManyToMany()
 {
     $event = new Event();
     $event->setTitle('Delete Restrict Event');
     $event->setStartDate(new fDate());
     $event->associateArtists(array(1));
     $event->store();
     $event->delete(TRUE);
     $this->assertEquals(FALSE, $event->exists());
 }
 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;
 }