[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/phpexcel/PHPExcel/Style/ -> Supervisor.php (source)

   1  <?php
   2  
   3  /**
   4   * PHPExcel_Style_Supervisor
   5   *
   6   * Copyright (c) 2006 - 2015 PHPExcel
   7   *
   8   * This library is free software; you can redistribute it and/or
   9   * modify it under the terms of the GNU Lesser General Public
  10   * License as published by the Free Software Foundation; either
  11   * version 2.1 of the License, or (at your option) any later version.
  12   *
  13   * This library is distributed in the hope that it will be useful,
  14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16   * Lesser General Public License for more details.
  17   *
  18   * You should have received a copy of the GNU Lesser General Public
  19   * License along with this library; if not, write to the Free Software
  20   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  21   *
  22   * @category   PHPExcel
  23   * @package    PHPExcel_Style
  24   * @copyright  Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
  25   * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  26   * @version    ##VERSION##, ##DATE##
  27   */
  28  abstract class PHPExcel_Style_Supervisor
  29  {
  30      /**
  31       * Supervisor?
  32       *
  33       * @var boolean
  34       */
  35      protected $isSupervisor;
  36  
  37      /**
  38       * Parent. Only used for supervisor
  39       *
  40       * @var PHPExcel_Style
  41       */
  42      protected $parent;
  43  
  44      /**
  45       * Create a new PHPExcel_Style_Alignment
  46       *
  47       * @param    boolean    $isSupervisor    Flag indicating if this is a supervisor or not
  48       *                                    Leave this value at default unless you understand exactly what
  49       *                                        its ramifications are
  50       */
  51      public function __construct($isSupervisor = false)
  52      {
  53          // Supervisor?
  54          $this->isSupervisor = $isSupervisor;
  55      }
  56  
  57      /**
  58       * Bind parent. Only used for supervisor
  59       *
  60       * @param PHPExcel $parent
  61       * @return PHPExcel_Style_Supervisor
  62       */
  63      public function bindParent($parent, $parentPropertyName = null)
  64      {
  65          $this->parent = $parent;
  66          return $this;
  67      }
  68  
  69      /**
  70       * Is this a supervisor or a cell style component?
  71       *
  72       * @return boolean
  73       */
  74      public function getIsSupervisor()
  75      {
  76          return $this->isSupervisor;
  77      }
  78  
  79      /**
  80       * Get the currently active sheet. Only used for supervisor
  81       *
  82       * @return PHPExcel_Worksheet
  83       */
  84      public function getActiveSheet()
  85      {
  86          return $this->parent->getActiveSheet();
  87      }
  88  
  89      /**
  90       * Get the currently active cell coordinate in currently active sheet.
  91       * Only used for supervisor
  92       *
  93       * @return string E.g. 'A1'
  94       */
  95      public function getSelectedCells()
  96      {
  97          return $this->getActiveSheet()->getSelectedCells();
  98      }
  99  
 100      /**
 101       * Get the currently active cell coordinate in currently active sheet.
 102       * Only used for supervisor
 103       *
 104       * @return string E.g. 'A1'
 105       */
 106      public function getActiveCell()
 107      {
 108          return $this->getActiveSheet()->getActiveCell();
 109      }
 110  
 111      /**
 112       * Implement PHP __clone to create a deep clone, not just a shallow copy.
 113       */
 114      public function __clone()
 115      {
 116          $vars = get_object_vars($this);
 117          foreach ($vars as $key => $value) {
 118              if ((is_object($value)) && ($key != 'parent')) {
 119                  $this->$key = clone $value;
 120              } else {
 121                  $this->$key = $value;
 122              }
 123          }
 124      }
 125  }


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1