closedquestion-8.x-3.x-dev/src/Question/Mapping/CqAbstractHotspot.php
src/Question/Mapping/CqAbstractHotspot.php
<?php
namespace Drupal\closedquestion\Question\Mapping;
/**
* Functions as base for all hotspot classes.
*/
abstract class CqAbstractHotspot implements CqHotspotInterface {
/**
* The identifier of the hotspot.
*
* @var string
*/
protected $identifier = 'NoName';
/**
* The description for this hotspot.
*
* @var string
*/
protected $description;
/**
* The images for this hotspot.
*
* @var string
*/
protected $images = array();
/**
* Implements CqHotspotInterface::getIdentifier().
*/
public function getIdentifier() {
return $this->identifier;
}
/**
* Implements CqHotspotInterface::setDescription().
*/
public function setDescription($description) {
$this->description = $description;
}
/**
* Implements CqHotspotInterface::getDescription().
*/
public function getDescription() {
return $this->description;
}
/**
* Implements CqHotspotInterface::addImage().
*/
public function addImage($type, $url, $offset) {
$offset = $offset == '' ? '0,0' : $offset;
$this->images[$type] = array(
'url' => $url,
'offset' => explode(',', $offset),
);
}
/**
* Implements CqHotspotInterface::getImages().
*/
public function getImages() {
return $this->images;
}
}
