protected function QuizResultAnswerStorage::doCreate in Quiz 8.5
Same name and namespace in other branches
- 8.6 src/Storage/QuizResultAnswerStorage.php \Drupal\quiz\Storage\QuizResultAnswerStorage::doCreate()
- 6.x src/Storage/QuizResultAnswerStorage.php \Drupal\quiz\Storage\QuizResultAnswerStorage::doCreate()
When creating a new entity, map any object to its respective class.
Overrides ContentEntityStorageBase::doCreate
File
- src/
Storage/ QuizResultAnswerStorage.php, line 15
Class
Namespace
Drupal\quiz\StorageCode
protected function doCreate(array $values) {
$pluginManager = Drupal::service('plugin.manager.quiz.question');
$plugins = $pluginManager
->getDefinitions();
$ret = $plugins[$values['type']];
if ($ret['handlers']['response']) {
$this->entityClass = $ret['handlers']['response'];
}
else {
$this->entityClass = 'Drupal\\quiz\\Entity\\QuizResultAnswerBroken';
}
return parent::doCreate($values);
}