Example #1
0
 /**
  * Get the street address of this event if applicable
  * @since Version 3.10.0
  * @return string
  */
 public function getAddress()
 {
     if (!empty($this->meta['address'])) {
         return $this->meta['address'];
     }
     if (!empty($this->Event->meta['address'])) {
         return $this->Event->meta['address'];
     }
     if (!$this->Place instanceof Place || $this->Event->Place instanceof Place) {
         return;
     }
     if ($this->Place instanceof Place) {
         $this->meta['address'] = $this->Place->getAddress();
         $this->commit();
         return $this->meta['address'];
     }
     if ($this->Event->Place instanceof Place) {
         $this->Event->meta['address'] = $this->Event->Place->getAddress();
         $this->Event->commit();
         return $this->Event->meta['address'];
     }
 }
Example #2
0
 /**
  * @depends testAddEvent
  */
 public function testAddPlace($event_id)
 {
     $Event = new Event($event_id);
     $Place = new Place(self::LAT, self::LON);
     $Event->Place = $Place;
     $Event->commit();
     return $Event->id;
 }