当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_Style::getHashCode方法代码示例

本文整理汇总了PHP中PHPExcel_Style::getHashCode方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Style::getHashCode方法的具体用法?PHP PHPExcel_Style::getHashCode怎么用?PHP PHPExcel_Style::getHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_Style的用法示例。


在下文中一共展示了PHPExcel_Style::getHashCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getHashCode

	/**
	 * Get hash code
	 *
	 * @return string	Hash code
	 */
	public function getHashCode() {
    	return md5(
    		  $this->_conditionType
    		. $this->_operatorType
    		. $this->_condition
    		. $this->_style->getHashCode()
    		. __CLASS__
    	);
    }
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:14,代码来源:Conditional.php

示例2: duplicateStyle

 /**
  * Duplicate cell style to a range of cells
  *
  * Please note that this will overwrite existing cell styles for cells in range!
  *
  * @param PHPExcel_Style $pCellStyle Cell style to duplicate
  * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
  * @throws PHPExcel_Exception
  * @return PHPExcel_Worksheet
  */
 public function duplicateStyle(PHPExcel_Style $pCellStyle = null, $pRange = '')
 {
     // make sure we have a real style and not supervisor
     $style = $pCellStyle->getIsSupervisor() ? $pCellStyle->getSharedComponent() : $pCellStyle;
     // Add the style to the workbook if necessary
     $workbook = $this->_parent;
     if ($existingStyle = $this->_parent->getCellXfByHashCode($pCellStyle->getHashCode())) {
         // there is already such cell Xf in our collection
         $xfIndex = $existingStyle->getIndex();
     } else {
         // we don't have such a cell Xf, need to add
         $workbook->addCellXf($pCellStyle);
         $xfIndex = $pCellStyle->getIndex();
     }
     // Calculate range outer borders
     list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange . ':' . $pRange);
     // Make sure we can loop upwards on rows and columns
     if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
         $tmp = $rangeStart;
         $rangeStart = $rangeEnd;
         $rangeEnd = $tmp;
     }
     // Loop through cells and apply styles
     for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
         for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
             $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col - 1) . $row)->setXfIndex($xfIndex);
         }
     }
     return $this;
 }
开发者ID:andrelotto,项目名称:EmailMarketing,代码行数:40,代码来源:Worksheet.php

示例3: duplicateStyle

 /**
  * Duplicate cell style to a range of cells
  *
  * Please note that this will overwrite existing cell styles for cells in range!
  *
  * @param	PHPExcel_Style	$pCellStyle	Cell style to duplicate
  * @param	string			$pRange		Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
  * @throws	Exception
  * @return PHPExcel_Worksheet
  */
 public function duplicateStyle(PHPExcel_Style $pCellStyle = null, $pRange = '')
 {
     // make sure we have a real style and not supervisor
     $style = $pCellStyle->getIsSupervisor() ? $pCellStyle->getSharedComponent() : $pCellStyle;
     // Add the style to the workbook if necessary
     $workbook = $this->_parent;
     if ($existingStyle = $this->_parent->getCellXfByHashCode($pCellStyle->getHashCode())) {
         // there is already such cell Xf in our collection
         $xfIndex = $existingStyle->getIndex();
     } else {
         // we don't have such a cell Xf, need to add
         $workbook->addCellXf($pCellStyle);
         $xfIndex = $pCellStyle->getIndex();
     }
     // Uppercase coordinate
     $pRange = strtoupper($pRange);
     // Is it a cell range or a single cell?
     $rangeA = '';
     $rangeB = '';
     if (strpos($pRange, ':') === false) {
         $rangeA = $pRange;
         $rangeB = $pRange;
     } else {
         list($rangeA, $rangeB) = explode(':', $pRange);
     }
     // Calculate range outer borders
     $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
     $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB);
     // Translate column into index
     $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
     $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
     // Make sure we can loop upwards on rows and columns
     if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
         $tmp = $rangeStart;
         $rangeStart = $rangeEnd;
         $rangeEnd = $tmp;
     }
     // Loop through cells and apply styles
     for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
         for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
             $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col) . $row)->setXfIndex($xfIndex);
         }
     }
     return $this;
 }
开发者ID:azizbekvahidov,项目名称:foods,代码行数:55,代码来源:Worksheet.php

示例4: _createCSSStyle

 /**
  * Create CSS style
  * 
  * @param	PHPExcel_Style 		$pStyle			PHPExcel_Style
  * @return	string
  */
 private function _createCSSStyle(PHPExcel_Style $pStyle)
 {
     // Construct HTML
     $html = '';
     // Create CSS
     $html .= '      .style' . $pStyle->getHashCode() . ' {' . "\r\n";
     $html .= $this->_createCSSStyleAlignment($pStyle->getAlignment());
     $html .= $this->_createCSSStyleFont($pStyle->getFont());
     $html .= $this->_createCSSStyleBorders($pStyle->getBorders());
     $html .= $this->_createCSSStyleFill($pStyle->getFill());
     $html .= '      }' . "\r\n";
     // Return
     return $html;
 }
开发者ID:laiello,项目名称:myopensources,代码行数:20,代码来源:HTML.php

示例5: getHashCode

 /**
  * Get hash code
  *
  * @return string    Hash code
  */
 public function getHashCode()
 {
     return md5($this->conditionType . $this->operatorType . implode(';', $this->condition) . $this->style->getHashCode() . __CLASS__);
 }
开发者ID:alyayazilim,项目名称:E-Ticaret-2015,代码行数:9,代码来源:Conditional.php


注:本文中的PHPExcel_Style::getHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。