protected function CourseObjectStorage::doCreate in Course 3.x
Same name and namespace in other branches
- 8.3 src/Storage/CourseObjectStorage.php \Drupal\course\Storage\CourseObjectStorage::doCreate()
- 8.2 src/Storage/CourseObjectStorage.php \Drupal\course\Storage\CourseObjectStorage::doCreate()
When creating a new entity, map any object to its respective class.
Overrides ContentEntityStorageBase::doCreate
File
- src/
Storage/ CourseObjectStorage.php, line 15
Class
Namespace
Drupal\course\StorageCode
protected function doCreate(array $values) {
$available = course_get_handlers();
$ret = $available[$values['object_type']] ?? [];
if ($ret['class']) {
$this->entityClass = $ret['class'];
}
else {
$this->entityClass = 'Drupal\\course\\Course\\Object\\CourseObjectBroken';
}
return parent::doCreate($values);
}