public static function createFromResponse(\SimpleXMLElement $response)
 {
     $venue = new Venue();
     $venue->setId((int) $response->id);
     $venue->setName((string) $response->name);
     $location = array();
     $location['city'] = (string) $response->location->city;
     $location['country'] = (string) $response->location->country;
     $location['street'] = (string) $response->location->street;
     $location['postalcode'] = (string) $response->location->postalcode;
     $venue->setLocation($location);
     $geoPoint = array();
     $geoLocation = $response->location->children('geo', true);
     $geoPoint['lat'] = (string) $geoLocation->point->lat;
     $geoPoint['long'] = (string) $geoLocation->point->long;
     $venue->setGeoPoint($geoPoint);
     $venue->setUrl((string) $response->url);
     $venue->setWebsite((string) $response->website);
     $venue->setPhoneNumber((string) $response->phonenumber);
     $images = array();
     foreach ($response->image as $image) {
         $imageAttributes = $image->attributes();
         if (!empty($imageAttributes->size)) {
             $images[(string) $imageAttributes->size] = (string) $image;
         }
     }
     $venue->setImages($images);
     return $venue;
 }
Exemple #2
0
 private function getTestVenue()
 {
     $v = new Venue();
     $v->setName(get_class($this) . ': ' . date('Y-m-d_H:i:s'));
     $v->setDescription('Auto-generated by SimpleTest');
     $v->setPubState('Published');
     return $v;
 }
 /**
  * A temporary method of generating test data.  Will be
  * refactored out once all services have been implemented.
  * @param bean the EventSUmmaryPage bean
  * @return bean the EventSUmmaryPage bean w/ stubbed data
  */
 private function loadDemoSummaryData($model)
 {
     global $logger;
     $logger->debug(get_class($this) . '::loadTestSummaryData()');
     // Test Venues
     require_once WEB_INF . '/beans/Venue.php';
     $v1 = new Venue();
     $v1->setName('Hurd Gallery');
     $v1->setOid(48);
     $v2 = new Venue();
     $v2->setName('Taube Courtyard');
     $v2->setOid(24);
     $v3 = new venue();
     $v3->setName('Main Lobby');
     $v3->setOid(17);
     $venues = array($v1, $v2, $v3);
     // Test Audience
     require_once WEB_INF . '/beans/Audience.php';
     $a1 = new Audience();
     $a1->setName('All Age Groups');
     $a2 = new Audience();
     $a2->setName('Adults');
     $a3 = new Audience();
     $a3->setName('Toddlers');
     $audiences = array($a1, $a2, $a3);
     $list = $model->getList();
     foreach ($list as $event) {
         $event->setFamily($this->randomizeTestBoolean());
         $event->setAudience($this->randomizeTestArray($audiences, 1, 1));
     }
     $model->setEvents($list);
     // Page Announcement
     $msg = "<strong>This is some introductory text about this section of " . "the web site if needed.</strong>  Otherwise this would not be " . "here and everything below would move up so that there isn't a " . "big blank space.";
     $model->setAnnouncement($msg);
     return $model;
 }
Exemple #4
0
 /**
  * Populates the Venue object from the request
  * @return bean Venue
  */
 private function getBeanFromRequest()
 {
     $venue = new Venue();
     $addr = new Address();
     $addr->setOid($_REQUEST['aoid']);
     $addr->setStreet($_REQUEST['street']);
     $addr->setUnit($_REQUEST['unit']);
     $addr->setCity($_REQUEST['city']);
     $addr->setState($_REQUEST['state']);
     $addr->setPostalCode($_REQUEST['postalCode']);
     $addr->setPhone($_REQUEST['phone']);
     $venue->setOid($_REQUEST['oid']);
     $venue->setName($_REQUEST['name']);
     $venue->setDescription($_REQUEST['description']);
     $venue->setPubState($_REQUEST['pubState']);
     $venue->setAddress($addr);
     if (isset($_REQUEST['gallery'])) {
         $venue->setGallery($_REQUEST['gallery']);
     }
     $links = array();
     //$links['exhibition'] = $_REQUEST['exhibition'];
     //$links['program'] = isset($_REQUEST['program']) ? $_REQUEST['program'] : null;
     //$links['course'] = isset($_REQUEST['course']) ? $_REQUEST['course'] : null;
     $venue->setEvents($links);
     return $venue;
 }
Exemple #5
0
 /**
  * A sample detail bean for use in rendering the template.
  * If a course is supplied, it will copy thevalues of the
  * given bean over the top of the demo bean.
  * @return
  */
 private function getDemoCourseDetail($crse)
 {
     require_once WEB_INF . '/beans/Performance.php';
     require_once WEB_INF . '/beans/Schedule.php';
     require_once WEB_INF . '/beans/Venue.php';
     global $logger;
     $logger->debug(get_class($this) . "::getDemoCourseDetail({$crse})");
     $bean = new Course();
     $bean->setTitle("Demo Course Detail Bean");
     $desc = "<p>This is a description of the course. Malian Grammy Award nominee Mamadou Diabate is a virtuoso kora player descended from a long line of Manding musician-storytellers. Dolor dignissim exerci feugiat. Lobortis ut, luptatum facilisis. Augue volutpat facilisis at, eum consequat adipiscing accumsan blandit molestie. </p>\n\t\t\t\t <p>Lobortis eros at hendrerit luptatum consequat feugiat ut facilisi commodo esse autem consequat at ex ullamcorper hendrerit wisi, commodo nostrud nisl wisi eum autem eu esse eu iriure. Tation, magna ad nibh at eum, ea praesent eum lorem eu erat enim commodo dolore?</p>\n \t\t\t\t <p>Crisare enim sed ex eros hendrerit blandit illum qui sciurus autem nulla enim luptatum. Quis enim eum feugait elit blandit, hendrerit consequat, velit ut luptatum nostrud wisi ea. Dignissim consequat dolore aliquam eum volutpat, wisi dolore et exerci nisl veniam luptatum ut ullamcorper consequatvel nulla delenit.</p>\n\t\t\t\t";
     $bean->setDescription($desc);
     $bean->setPrimaryGenre("Music");
     // Performances
     $perf = new Performance();
     $schd = new Schedule();
     $schd->setStartTime(time());
     $perf->setSchedule($schd);
     $logger->debug("Performance time: " . $perf->getSchedule()->getStartTime());
     $perf->setTicketCode("21");
     $bean->setChildren(array($perf));
     $logger->debug("Number of set performaces: " . count($bean->getChildren()));
     // Venues
     $v1 = new Venue();
     $v1->setName('Hurd Gallery');
     $bean->setDefaultVenue($v1);
     if (get_class($crse) == 'Course') {
         $crse->setPerformances(null);
         $option = new CopyBeanOption();
         $option->setIgnoreNullValues(true);
         BeanUtil::copyBean($crse, $bean, $option);
     }
     return $bean;
 }