Prado\Web\UI\WebControls\TPanelStyle::mergeWith PHP Method

mergeWith() public method

If a style field is not set in this style, it will be overwritten by the new one.
public mergeWith ( $style )
    public function mergeWith($style)
    {
        parent::mergeWith($style);
        if ($style instanceof TPanelStyle) {
            if ($this->_backImageUrl === null && $style->_backImageUrl !== null) {
                $this->_backImageUrl = $style->_backImageUrl;
            }
            if ($this->_direction === null && $style->_direction !== null) {
                $this->_direction = $style->_direction;
            }
            if ($this->_horizontalAlign === null && $style->_horizontalAlign !== null) {
                $this->_horizontalAlign = $style->_horizontalAlign;
            }
            if ($this->_scrollBars === null && $style->_scrollBars !== null) {
                $this->_scrollBars = $style->_scrollBars;
            }
            if ($this->_wrap === null && $style->_wrap !== null) {
                $this->_wrap = $style->_wrap;
            }
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Merges the style with a new one.
  * If a style field is not set in this style, it will be overwritten by
  * the new one.
  * @param TStyle the new style
  */
 public function mergeWith($style)
 {
     parent::mergeWith($style);
     if ($style instanceof TDataGridPagerStyle) {
         if ($this->_visible === null) {
             $this->_visible = $style->_visible;
         }
         if ($this->_position === null) {
             $this->_position = $style->_position;
         }
         if ($this->_buttonCount === null) {
             $this->_buttonCount = $style->_buttonCount;
         }
         if ($this->_prevText === null) {
             $this->_prevText = $style->_prevText;
         }
         if ($this->_nextText === null) {
             $this->_nextText = $style->_nextText;
         }
         if ($this->_mode === null) {
             $this->_mode = $style->_mode;
         }
         if ($this->_buttonType === null) {
             $this->_buttonType = $style->_buttonType;
         }
     }
 }