You are here

public function PHPExcel_Writer_Excel2007_Style::allFills in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Style.php \PHPExcel_Writer_Excel2007_Style::allFills()

* Get an array of all fills * *

Parameters

PHPExcel $pPHPExcel: * @return PHPExcel_Style_Fill[] All fills in PHPExcel * @throws PHPExcel_Writer_Exception

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Style.php, line 618

Class

PHPExcel_Writer_Excel2007_Style
PHPExcel_Writer_Excel2007_Style

Code

public function allFills(PHPExcel $pPHPExcel = null) {

  // Get an array of unique fills
  $aFills = array();

  // Two first fills are predefined
  $fill0 = new PHPExcel_Style_Fill();
  $fill0
    ->setFillType(PHPExcel_Style_Fill::FILL_NONE);
  $aFills[] = $fill0;
  $fill1 = new PHPExcel_Style_Fill();
  $fill1
    ->setFillType(PHPExcel_Style_Fill::FILL_PATTERN_GRAY125);
  $aFills[] = $fill1;

  // The remaining fills
  $aStyles = $this
    ->allStyles($pPHPExcel);
  foreach ($aStyles as $style) {
    if (!array_key_exists($style
      ->getFill()
      ->getHashCode(), $aFills)) {
      $aFills[$style
        ->getFill()
        ->getHashCode()] = $style
        ->getFill();
    }
  }
  return $aFills;
}