/** * 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'); } }
/** * 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.'); } }