Updated Venue
This commit is contained in:
parent
fb1be54bb7
commit
38657c128d
1 changed files with 16 additions and 44 deletions
|
@ -6,40 +6,13 @@
|
||||||
|
|
||||||
class Venue implements ObjectTypeInterface
|
class Venue implements ObjectTypeInterface
|
||||||
{
|
{
|
||||||
/**
|
private Location $location;
|
||||||
* @var Location
|
private string $title;
|
||||||
*/
|
private string $address;
|
||||||
private $location;
|
private ?string $foursquare_id;
|
||||||
|
private ?string $foursquare_type;
|
||||||
/**
|
private ?string $google_place_id;
|
||||||
* @var string
|
private ?string $google_place_type;
|
||||||
*/
|
|
||||||
private $title;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
private $foursquare_id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
private $foursquare_type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
private $google_place_id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
private $google_place_type;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Venue location. Can't be a live location
|
* Venue location. Can't be a live location
|
||||||
|
@ -114,14 +87,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array representation of the object
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'location' => ($this->location instanceof ObjectTypeInterface) ? $this->location->toArray() : $this->location,
|
'location' => $this->location?->toArray(),
|
||||||
'title' => $this->title,
|
'title' => $this->title,
|
||||||
'address' => $this->address,
|
'address' => $this->address,
|
||||||
'foursquare_id' => $this->foursquare_id,
|
'foursquare_id' => $this->foursquare_id,
|
||||||
|
@ -132,15 +103,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs object from an array representation
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @param array $data
|
|
||||||
* @return Venue
|
|
||||||
*/
|
*/
|
||||||
public static function fromArray(array $data): self
|
public static function fromArray(?array $data): ?Venue
|
||||||
{
|
{
|
||||||
$object = new self();
|
if($data === null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$object = new self();
|
||||||
$object->location = isset($data['location']) ? Location::fromArray($data['location']) : null;
|
$object->location = isset($data['location']) ? Location::fromArray($data['location']) : null;
|
||||||
$object->title = $data['title'];
|
$object->title = $data['title'];
|
||||||
$object->address = $data['address'];
|
$object->address = $data['address'];
|
||||||
|
|
Loading…
Add table
Reference in a new issue