abstract class EntityQueueHandlerBase in Entityqueue 7
An abstract implementation of EntityQueueHandlerInterface.
Hierarchy
- class \EntityQueueHandlerBase implements EntityQueueHandlerInterface
Expanded class hierarchy of EntityQueueHandlerBase
File
- plugins/
entityqueue/ handler/ base.inc, line 97 - Contains Entityqueue handler interface and base class.
View source
abstract class EntityQueueHandlerBase implements EntityQueueHandlerInterface {
/**
* The handler plugin definition.
*
* @var array
*/
protected $plugin;
/**
* The EntityQueue object.
*
* @var EntityQueue
*/
protected $queue;
public static function getInstance(EntityQueue $queue) {
$entity_type = $queue->target_type;
// Check if the entity type does exist and has a base table.
$entity_info = entity_get_info($entity_type);
if (empty($entity_info['base table'])) {
return BrokenEntityQueueHandler::getInstance($queue);
}
// Check if the queue handler exists.
ctools_include('plugins');
$plugin = ctools_get_plugins('entityqueue', 'handler', $queue->handler);
if (empty($plugin)) {
return BrokenEntityQueueHandler::getInstance($queue);
}
return new $plugin['class']($queue);
}
protected function __construct(EntityQueue $queue) {
$this->queue = $queue;
ctools_include('plugins');
$plugin = ctools_get_plugins('entityqueue', 'handler', $this->queue->handler);
$this->plugin = $plugin;
}
public function settingsForm() {
return array();
}
public function subqueueForm(EntitySubqueue $subqueue, &$form_state) {
return array();
}
public function getTargetTypeLabel() {
$entity_info = entity_get_info($this->queue->target_type);
if (!empty($entity_info['base table'])) {
return $entity_info['label'];
}
return '<em>' . t('Missing entity type (@type)', array(
'@type' => $this->queue->target_type,
)) . '</em>';
}
public function getHandlerLabel() {
return $this->plugin['title'];
}
public function getSubqueueLabel(EntitySubqueue $subqueue) {
}
public function canDeleteSubqueue(EntitySubqueue $subqueue) {
return TRUE;
}
public function create() {
}
public function load() {
}
public function loadFromCode() {
}
public function preSave() {
}
public function insert() {
}
public function update() {
}
public function preDelete() {
}
public function postDelete() {
}
}