Prado\Web\UI\WebControls\TStyle::copyFrom PHP Méthode

copyFrom() public méthode

If a style field is set in the new style, the corresponding field in this style will be overwritten.
public copyFrom ( $style )
    public function copyFrom($style)
    {
        if ($style instanceof TStyle) {
            $this->_fields = array_merge($this->_fields, $style->_fields);
            if ($style->_class !== null) {
                $this->_class = $style->_class;
            }
            if ($style->_customStyle !== null) {
                $this->_customStyle = $style->_customStyle;
            }
            if ($style->_font !== null) {
                $this->getFont()->copyFrom($style->_font);
            }
        }
    }

Usage Example

 /**
  * Copies the fields in a new style to this style.
  * If a style field is set in the new style, the corresponding field
  * in this style will be overwritten.
  * @param TStyle the new style
  */
 public function copyFrom($style)
 {
     parent::copyFrom($style);
     if ($style instanceof TWizardNavigationButtonStyle) {
         if ($this->_imageUrl === null && $style->_imageUrl !== null) {
             $this->_imageUrl = $style->_imageUrl;
         }
         if ($this->_buttonText === null && $style->_buttonText !== null) {
             $this->_buttonText = $style->_buttonText;
         }
         if ($this->_buttonType === null && $style->_buttonType !== null) {
             $this->_buttonType = $style->_buttonType;
         }
     }
 }
All Usage Examples Of Prado\Web\UI\WebControls\TStyle::copyFrom