You are here

final public function CourseHandler::setOptions in Course 6

Same name and namespace in other branches
  1. 7.2 includes/CourseHandler.inc \CourseHandler::setOptions()
  2. 7 includes/CourseHandler.inc \CourseHandler::setOptions()

Set this entire handler's options.

Deserialize the serialized column if necessary.

Parameters

array $options: An array of options.

Return value

CourseHandler

4 calls to CourseHandler::setOptions()
CourseHandler::save in includes/course.core.inc
CourseHandler::__construct in includes/course.core.inc
CourseObject::optionsSubmit in includes/course_object.core.inc
Save object configs to cache.
CourseObjectFulfillment::__construct in includes/course_object.core.inc
Construct the fulfillment object.

File

includes/course.core.inc, line 110
course.core.inc File for main Course class.

Class

CourseHandler
@file course.core.inc File for main Course class.

Code

public final function setOptions($options) {
  $config = (array) $options;

  // Make sure the serialized field is not already extracted.
  if (isset($config[$this->serializedField]) && is_string($config[$this->serializedField])) {
    $data = unserialize($config[$this->serializedField]);
    if (is_array($data)) {

      // Merge serialized data onto options. Schema fields take precedence.
      $config = array_merge($data, $config);
    }
  }
  $this->config = $config;
  return $this;
}