You are here

public function CourseHandler::save in Course 7.2

Same name and namespace in other branches
  1. 6 includes/course.core.inc \CourseHandler::save()
  2. 7 includes/CourseHandler.inc \CourseHandler::save()

Permanently saves the entity.

Overrides Entity::save

See also

entity_save()

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::save in includes/CourseReport.inc
Permanently saves the entity.
3 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.
CourseReport::save in includes/CourseReport.inc
Permanently saves the entity.

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();
}