StorageBase.php in Checklist API 8
File
src/Storage/StorageBase.php
View source
<?php
namespace Drupal\checklistapi\Storage;
abstract class StorageBase implements StorageInterface {
private $checklistId;
public function setChecklistId($id) {
if (!is_string($id)) {
throw new \InvalidArgumentException('A checklist ID must be a string.');
}
$this->checklistId = $id;
return $this;
}
protected function getChecklistId() {
if (empty($this->checklistId)) {
throw new \LogicException('You must set the checklist ID before accessing saved progress.');
}
return $this->checklistId;
}
}
Classes
Name |
Description |
StorageBase |
Provides a base storage implementation for others to extend. |