mirror of
https://0xacab.org/radar/radar-wp.git
synced 2024-10-23 13:56:27 +02:00
120 lines
2.1 KiB
Text
120 lines
2.1 KiB
Text
|
<?php
|
||
|
|
||
|
namespace Radar\Connect\Entity;
|
||
|
|
||
|
class Group extends Node {
|
||
|
public $group_logo;
|
||
|
public $image;
|
||
|
public $email;
|
||
|
public $link;
|
||
|
public $offline;
|
||
|
public $opening_times;
|
||
|
public $phone;
|
||
|
|
||
|
function __construct($data = array()) {
|
||
|
parent::__construct($data);
|
||
|
$this->type = 'group';
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* TODO not appearing in the API output.
|
||
|
*/
|
||
|
public function getGroupLogoRaw() {
|
||
|
return $this->group_logo;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* TODO not appearing in the API output.
|
||
|
*/
|
||
|
public function getImageRaw() {
|
||
|
return $this->image->file;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return email.
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getEmail() {
|
||
|
return $this->email;
|
||
|
}
|
||
|
|
||
|
public function getEmailRaw() {
|
||
|
return $this->email;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return array of url links for the event.
|
||
|
*
|
||
|
* @return string[]
|
||
|
*/
|
||
|
public function getLink() {
|
||
|
$links = array();
|
||
|
foreach ($this->link as $link) {
|
||
|
$links[] = $link['url'];
|
||
|
}
|
||
|
return $links;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return array of array url links for the event.
|
||
|
*
|
||
|
* Keyed with 'url', and unused 'attributes'.
|
||
|
*
|
||
|
* @return array
|
||
|
*/
|
||
|
public function getLinkRaw() {
|
||
|
return $this->link;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return group locations.
|
||
|
*
|
||
|
* @return Location[]
|
||
|
*/
|
||
|
public function getLocations() {
|
||
|
$locations = array();
|
||
|
foreach ($this->offline as $location) {
|
||
|
$locations[] = new Location($location);
|
||
|
}
|
||
|
return $locations;
|
||
|
}
|
||
|
|
||
|
public function getLocationsRaw() {
|
||
|
return $this->offline;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return phone number.
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getPhone() {
|
||
|
return $this->phone;
|
||
|
}
|
||
|
|
||
|
public function getPhoneRaw() {
|
||
|
return $this->phone;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Free text description of opening times.
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getOpeningTimes() {
|
||
|
return (!empty($this->opening_times['value'])) ? $this->opening_times['value'] : '';
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Free text description of opening times.
|
||
|
*
|
||
|
* Keyed array with 'value', and 'format' the Radar internal name of the
|
||
|
* filter format used.
|
||
|
*/
|
||
|
public function getOpeningTimesRaw() {
|
||
|
return $this->opening_times;
|
||
|
}
|
||
|
}
|
||
|
|