예제 #1
0
 /**
  * Please use context_block::instance($blockinstanceid) if you need the instance of context.
  * Alternatively if you know only the context id use context::instance_by_id($contextid)
  *
  * @param stdClass $record
  */
 protected function __construct(stdClass $record)
 {
     parent::__construct($record);
     if ($record->contextlevel != CONTEXT_BLOCK) {
         throw new coding_exception('Invalid $record->contextlevel in context_block constructor');
     }
 }
예제 #2
0
 /**
  * Please use context_costcenter::instance($costcenterid) if you need the instance of context.
  * Alternatively if you know only the context id use context::instance_by_id($contextid)
  *
  * @param stdClass $record
  */
 protected function __construct(stdClass $record) {
     parent::__construct($record);
     if ($record->contextlevel != CONTEXT_COSTCENTER) {
         throw new coding_exception('Invalid $record->contextlevel in context_costcenter constructor.');
     }
 }