public function set_component($component) {
        if (!empty($this->component) && $this->component !== $component) {
            throw new coding_exception('You cannot change the component of a comment once it has been set');
        }
        $this->component = $component;
        list($this->plugintype, $this->pluginname) = core_component::normalize_component($component);
    }
public function set_component($component) {
        if (!empty($this->component) && $this->component !== $component) {
            throw new coding_exception('You cannot change the component of a comment once it has been set');
        }
        $this->component = $component;
        list($this->plugintype, $this->pluginname) = core_component::normalize_component($component);
    }
public function set_component ( $ component ) { if ( ! empty ( $ this -> component ) && $ this -> component !== $ component ) { throw new coding_exception ( 'You cannot change the component of a comment once it has been set' ) ; } $ this -> component = $ component ; list ( $ this -> plugintype , $ this -> pluginname ) = core_component :: normalize_component ( $ component ) ; }
Sets the component.

This method shouldn't be public, changing the component once it has been set potentially
invalidates permission checks.
A coding_error is now thrown if code attempts to change the component.

@throws coding_exception if you try to change the component after it has been set.
@param string $component
Sets the component .