function apply (Component $component)
  {
    if ($component->supportsProperties()) {
      if ($this->props)
        $component->props->applyDefaults ($this->props);
      if ($this->unset)
        foreach ($this->unset as $prop)
          unset ($component->props->$prop);
    }

    if ($this->content) {
      $component->removeChildren();
      Metadata::compile ($this->content, $component);
    }
    if ($this->prepend)
      Metadata::compile ($this->prepend, $component, true);
    if ($this->append)
      Metadata::compile ($this->append, $component);
  }
function apply (Component $component)
  {
    if ($component->supportsProperties()) {
      if ($this->props)
        $component->props->applyDefaults ($this->props);
      if ($this->unset)
        foreach ($this->unset as $prop)
          unset ($component->props->$prop);
    }

    if ($this->content) {
      $component->removeChildren();
      Metadata::compile ($this->content, $component);
    }
    if ($this->prepend)
      Metadata::compile ($this->prepend, $component, true);
    if ($this->append)
      Metadata::compile ($this->append, $component);
  }
function apply ( Component $ component ) { if ( $ component -> supportsProperties ( ) ) { if ( $ this -> props ) $ component -> props -> applyDefaults ( $ this -> props ) ; if ( $ this -> unset ) foreach ( $ this -> unset as $ prop ) unset ( $ component -> props -> $ prop ) ; } if ( $ this -> content ) { $ component -> removeChildren ( ) ; Metadata :: compile ( $ this -> content , $ component ) ; } if ( $ this -> prepend ) Metadata :: compile ( $ this -> prepend , $ component , true ) ; if ( $ this -> append ) Metadata :: compile ( $ this -> append , $ component ) ; }
Apply the preset to the given component.

@param Component $component
@throws \Matisse\Exceptions\ComponentException
@throws \Matisse\Exceptions\ReflectionPropertyException
Apply the preset to the given component .