You are here

class PHPExcel_Worksheet_Drawing in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/Drawing.php \PHPExcel_Worksheet_Drawing

PHPExcel_Worksheet_Drawing

@category PHPExcel @package PHPExcel_Worksheet_Drawing @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

Hierarchy

Expanded class hierarchy of PHPExcel_Worksheet_Drawing

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/Drawing.php, line 36

View source
class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable {

  /**
   * Path
   *
   * @var string
   */
  private $_path;

  /**
   * Create a new PHPExcel_Worksheet_Drawing
   */
  public function __construct() {

    // Initialise values
    $this->_path = '';

    // Initialize parent
    parent::__construct();
  }

  /**
   * Get Filename
   *
   * @return string
   */
  public function getFilename() {
    return basename($this->_path);
  }

  /**
   * Get indexed filename (using image index)
   *
   * @return string
   */
  public function getIndexedFilename() {
    $fileName = $this
      ->getFilename();
    $fileName = str_replace(' ', '_', $fileName);
    return str_replace('.' . $this
      ->getExtension(), '', $fileName) . $this
      ->getImageIndex() . '.' . $this
      ->getExtension();
  }

  /**
   * Get Extension
   *
   * @return string
   */
  public function getExtension() {
    $exploded = explode(".", basename($this->_path));
    return $exploded[count($exploded) - 1];
  }

  /**
   * Get Path
   *
   * @return string
   */
  public function getPath() {
    return $this->_path;
  }

  /**
   * Set Path
   *
   * @param 	string 		$pValue			File path
   * @param 	boolean		$pVerifyFile	Verify file
   * @throws 	PHPExcel_Exception
   * @return PHPExcel_Worksheet_Drawing
   */
  public function setPath($pValue = '', $pVerifyFile = true) {
    if ($pVerifyFile) {
      if (file_exists($pValue)) {
        $this->_path = $pValue;
        if ($this->_width == 0 && $this->_height == 0) {

          // Get width/height
          list($this->_width, $this->_height) = getimagesize($pValue);
        }
      }
      else {
        throw new PHPExcel_Exception("File {$pValue} not found!");
      }
    }
    else {
      $this->_path = $pValue;
    }
    return $this;
  }

  /**
   * Get hash code
   *
   * @return string	Hash code
   */
  public function getHashCode() {
    return md5($this->_path . parent::getHashCode() . __CLASS__);
  }

  /**
   * Implement PHP __clone to create a deep clone, not just a shallow copy.
   */
  public function __clone() {
    $vars = get_object_vars($this);
    foreach ($vars as $key => $value) {
      if (is_object($value)) {
        $this->{$key} = clone $value;
      }
      else {
        $this->{$key} = $value;
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PHPExcel_Worksheet_BaseDrawing::$_coordinates protected property * Coordinates * *
PHPExcel_Worksheet_BaseDrawing::$_description protected property * Description * *
PHPExcel_Worksheet_BaseDrawing::$_height protected property * Height * * 1
PHPExcel_Worksheet_BaseDrawing::$_imageCounter private static property * Image counter * *
PHPExcel_Worksheet_BaseDrawing::$_imageIndex private property * Image index * *
PHPExcel_Worksheet_BaseDrawing::$_name protected property * Name * * 1
PHPExcel_Worksheet_BaseDrawing::$_offsetX protected property * Offset X * * 1
PHPExcel_Worksheet_BaseDrawing::$_offsetY protected property * Offset Y * * 1
PHPExcel_Worksheet_BaseDrawing::$_resizeProportional protected property * Proportional resize * * 1
PHPExcel_Worksheet_BaseDrawing::$_rotation protected property * Rotation * *
PHPExcel_Worksheet_BaseDrawing::$_shadow protected property * Shadow * *
PHPExcel_Worksheet_BaseDrawing::$_width protected property * Width * * 1
PHPExcel_Worksheet_BaseDrawing::$_worksheet protected property * Worksheet * *
PHPExcel_Worksheet_BaseDrawing::getCoordinates public function Get Coordinates
PHPExcel_Worksheet_BaseDrawing::getDescription public function Get Description
PHPExcel_Worksheet_BaseDrawing::getHeight public function Get Height 1
PHPExcel_Worksheet_BaseDrawing::getImageIndex public function Get image index
PHPExcel_Worksheet_BaseDrawing::getName public function Get Name 1
PHPExcel_Worksheet_BaseDrawing::getOffsetX public function Get OffsetX 1
PHPExcel_Worksheet_BaseDrawing::getOffsetY public function Get OffsetY 1
PHPExcel_Worksheet_BaseDrawing::getResizeProportional public function Get ResizeProportional 1
PHPExcel_Worksheet_BaseDrawing::getRotation public function Get Rotation
PHPExcel_Worksheet_BaseDrawing::getShadow public function Get Shadow
PHPExcel_Worksheet_BaseDrawing::getWidth public function Get Width 1
PHPExcel_Worksheet_BaseDrawing::getWorksheet public function Get Worksheet
PHPExcel_Worksheet_BaseDrawing::setCoordinates public function Set Coordinates
PHPExcel_Worksheet_BaseDrawing::setDescription public function Set Description
PHPExcel_Worksheet_BaseDrawing::setHeight public function Set Height 1
PHPExcel_Worksheet_BaseDrawing::setName public function Set Name 1
PHPExcel_Worksheet_BaseDrawing::setOffsetX public function Set OffsetX 1
PHPExcel_Worksheet_BaseDrawing::setOffsetY public function Set OffsetY 1
PHPExcel_Worksheet_BaseDrawing::setResizeProportional public function Set ResizeProportional 1
PHPExcel_Worksheet_BaseDrawing::setRotation public function Set Rotation
PHPExcel_Worksheet_BaseDrawing::setShadow public function Set Shadow
PHPExcel_Worksheet_BaseDrawing::setWidth public function Set Width 1
PHPExcel_Worksheet_BaseDrawing::setWidthAndHeight public function Set width and height with proportional resize * Example: * <code> * $objDrawing->setResizeProportional(true); * $objDrawing->setWidthAndHeight(160,120); * </code> * @author Vincent@luo MSN:kele_100@hotmail.com 1
PHPExcel_Worksheet_BaseDrawing::setWorksheet public function Set Worksheet
PHPExcel_Worksheet_Drawing::$_path private property * Path * * 1
PHPExcel_Worksheet_Drawing::getExtension public function Get Extension 1
PHPExcel_Worksheet_Drawing::getFilename public function Get Filename 1
PHPExcel_Worksheet_Drawing::getHashCode public function * Get hash code * * Overrides PHPExcel_Worksheet_BaseDrawing::getHashCode 1
PHPExcel_Worksheet_Drawing::getIndexedFilename public function Get indexed filename (using image index)
PHPExcel_Worksheet_Drawing::getPath public function Get Path 1
PHPExcel_Worksheet_Drawing::setPath public function Set Path 1
PHPExcel_Worksheet_Drawing::__clone public function * Implement PHP __clone to create a deep clone, not just a shallow copy. Overrides PHPExcel_Worksheet_BaseDrawing::__clone 1
PHPExcel_Worksheet_Drawing::__construct public function Create a new PHPExcel_Worksheet_Drawing Overrides PHPExcel_Worksheet_BaseDrawing::__construct 1