zeg1jeux/lib/GchangeRecord.class.php

57 lines
982 B
PHP

<?php
class GchangeRecord {
use Locatable, Avatarable;
private $gchangeId;
private $title;
private $description;
private $type;
public function __construct ($gchangeObject) {
$this->gchangeId = $gchangeObject->_id;
$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)) {
$this->avatarImgSrc = 'data:'. $gchangeObject->_source->avatar->_content_type .';base64,' . $gchangeObject->_source->avatar->_content;
}
}
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 () {
return $this->getAvatarImgSrc();
}
}