public function CourseHandler::save in Course 7
Same name and namespace in other branches
- 6 includes/course.core.inc \CourseHandler::save()
- 7.2 includes/CourseHandler.inc \CourseHandler::save()
Permanently saves the entity.
Overrides Entity::save
See also
3 calls to CourseHandler::save()
- CourseObject::save in includes/
CourseObject.inc - Let objects create their instances before saving the course object.
- CourseObjectFulfillment::save in includes/
CourseObjectFulfillment.inc - Track course after saving fulfillment.
- CourseReport::track in includes/
CourseReport.inc - Track the course (scan required objects, update progress, completion, etc).
2 methods override CourseHandler::save()
- CourseObject::save in includes/
CourseObject.inc - Let objects create their instances before saving the course object.
- CourseObjectFulfillment::save in includes/
CourseObjectFulfillment.inc - Track course after saving fulfillment.
File
- includes/
CourseHandler.inc, line 220
Class
- CourseHandler
- Master class for anything Course related.
Code
public function save() {
$info = $this
->entityInfo();
$schema = drupal_get_schema($info['base table']);
foreach ($schema['fields'] as $field_name => $info) {
if (!empty($info['serialize'])) {
$serialized_field = $field_name;
}
$real_fields[$field_name] = $field_name;
}
$options = $this
->getOptions();
$strict_options = array_intersect_key($options, $this
->optionsDefinition());
$this->{$serialized_field} = array_diff_key($strict_options, $real_fields);
parent::save();
}