2022-10-24 19:14:58 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class GchangeRecord {
|
|
|
|
|
2022-11-17 16:53:09 +01:00
|
|
|
use Locatable, Avatarable;
|
|
|
|
|
2022-10-24 19:14:58 +02:00
|
|
|
private $gchangeId;
|
|
|
|
|
|
|
|
private $title;
|
|
|
|
|
|
|
|
private $description;
|
|
|
|
|
|
|
|
private $type;
|
|
|
|
|
|
|
|
|
|
|
|
public function __construct ($gchangeObject) {
|
|
|
|
|
2022-10-30 22:12:18 +01:00
|
|
|
$this->gchangeId = $gchangeObject->_id;
|
2022-10-24 19:14:58 +02:00
|
|
|
|
|
|
|
$this->type = $gchangeObject->_source->type;
|
|
|
|
|
|
|
|
$this->title = $gchangeObject->_source->title;
|
|
|
|
|
|
|
|
$this->description = $gchangeObject->_source->description;
|
|
|
|
|
|
|
|
if (isset($gchangeObject->_source->avatar->_content) and
|
|
|
|
!empty($gchangeObject->_source->avatar->_content)) {
|
|
|
|
|
2022-11-17 16:53:09 +01:00
|
|
|
$this->avatarImgSrc = 'data:'. $gchangeObject->_source->avatar->_content_type .';base64,' . $gchangeObject->_source->avatar->_content;
|
2022-10-24 19:14:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getGchangeId () {
|
|
|
|
|
|
|
|
return $this->gchangeId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getType () {
|
|
|
|
|
|
|
|
return $this->type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitle () {
|
|
|
|
|
|
|
|
return $this->title;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDescription () {
|
|
|
|
|
|
|
|
return $this->description;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getImgSrc () {
|
|
|
|
|
2022-11-17 16:53:09 +01:00
|
|
|
return $this->getAvatarImgSrc();
|
2022-10-24 19:14:58 +02:00
|
|
|
}
|
|
|
|
}
|