You are here

public function CourseObjectFulfillmentController::create in Course 7

Same name and namespace in other branches
  1. 7.2 includes/CourseObjectFulfillmentController.inc \CourseObjectFulfillmentController::create()

Overrides EntityAPIController::create().

Overrides EntityAPIController::create

1 call to CourseObjectFulfillmentController::create()
CourseObjectFulfillmentController::query in includes/CourseObjectFulfillmentController.inc
Overrides EntityAPIController::query().

File

includes/CourseObjectFulfillmentController.inc, line 62

Class

CourseObjectFulfillmentController

Code

public function create(array $values = array()) {

  // Add is_new property if it is not set.
  $values += array(
    'is_new' => TRUE,
  );
  $available = course_get_handlers('object');
  $ret = $available[$values['module']][$values['object_type']];
  if (isset($ret['fulfillment class'])) {
    $class = $ret['fulfillment class'];
  }
  else {

    // Base class which minimally handles fulfillments.
    $class = 'CourseObjectFulfillment';
  }
  return new $class($values, $this->entityType);
}