function setProps (array $props = null)
  {
    if ($this->propsClass) {
      if (!class_exists ($this->propsClass, false)) {
        $this->context
          ->getMacrosService ()
          ->setupMacroProperties ($this->propsClass, $this->templateUrl, function () {
            $this->createView ();
            // Return the Macro instance.
            return $this->getShadowDOM ()->getFirstChild ();
          });
      }
      $this->props = new $this->propsClass ($this);
      if ($props)
        $this->props->apply ($props);
    }
    elseif ($props)
      throw new ComponentException($this, 'This component does not support properties.');
  }
function setProps (array $props = null)
  {
    if ($this->propsClass) {
      if (!class_exists ($this->propsClass, false)) {
        $this->context
          ->getMacrosService ()
          ->setupMacroProperties ($this->propsClass, $this->templateUrl, function () {
            $this->createView ();
            // Return the Macro instance.
            return $this->getShadowDOM ()->getFirstChild ();
          });
      }
      $this->props = new $this->propsClass ($this);
      if ($props)
        $this->props->apply ($props);
    }
    elseif ($props)
      throw new ComponentException($this, 'This component does not support properties.');
  }
function setProps ( array $ props = null ) { if ( $ this -> propsClass ) { if ( ! class_exists ( $ this -> propsClass , false ) ) { $ this -> context -> getMacrosService ( ) -> setupMacroProperties ( $ this -> propsClass , $ this -> templateUrl , function ( ) { $ this -> createView ( ) ; // Return the Macro instance. return $ this -> getShadowDOM ( ) -> getFirstChild ( ) ; } ) ; } $ this -> props = new $ this -> propsClass ( $ this ) ; if ( $ props ) $ this -> props -> apply ( $ props ) ; } elseif ( $ props ) throw new ComponentException ( $ this , 'This component does not support properties.' ) ; }
Creates the properties object from the class generated for this macro type and copies the property values to it.

If no properties class is generated yet, this method will compile it.

@param array|null $props
@throws ComponentException
@throws MatisseException
@throws ReflectionPropertyException
Creates the properties object from the class generated for this macro type and copies the property values to it .