116        $this->description = 
'';
 
  117        $this->worksheet = 
null;
 
  118        $this->coordinates = 
'A1';
 
  123        $this->resizeProportional = 
true;
 
  161        $this->name = $pValue;
 
  210        if ($this->worksheet === 
null) {
 
  212            $this->worksheet = $pValue;
 
  213            $this->worksheet->getCell($this->coordinates);
 
  214            $this->worksheet->getDrawingCollection()->append($this);
 
  218                $iterator = $this->worksheet->getDrawingCollection()->getIterator();
 
  220                while ($iterator->valid()) {
 
  221                    if ($iterator->current()->getHashCode() === $this->getHashCode()) {
 
  222                        $this->worksheet->getDrawingCollection()->offsetUnset($iterator->key());
 
  223                        $this->worksheet = 
null;
 
  232                throw new PhpSpreadsheetException(
'A Worksheet has already been assigned. Drawings can only exist on one \\PhpOffice\\PhpSpreadsheet\\Worksheet.');
 
  258        $this->coordinates = $pValue;
 
  282        $this->offsetX = $pValue;
 
  306        $this->offsetY = $pValue;
 
  331        if ($this->resizeProportional && $pValue != 0) {
 
  332            $ratio = $this->height / ($this->width != 0 ? $this->width : 1);
 
  333            $this->height = (int) round($ratio * $pValue);
 
  337        $this->width = $pValue;
 
  362        if ($this->resizeProportional && $pValue != 0) {
 
  363            $ratio = $this->width / ($this->height != 0 ? $this->height : 1);
 
  364            $this->width = (int) round($ratio * $pValue);
 
  368        $this->height = $pValue;
 
  391        $xratio = 
$width / ($this->width != 0 ? $this->width : 1);
 
  392        $yratio = 
$height / ($this->height != 0 ? $this->height : 1);
 
  393        if ($this->resizeProportional && !(
$width == 0 || 
$height == 0)) {
 
  394            if (($xratio * $this->height) < 
$height) {
 
  395                $this->height = (int) ceil($xratio * $this->height);
 
  398                $this->width = (int) ceil($yratio * $this->width);
 
  428        $this->resizeProportional = $pValue;
 
  452        $this->rotation = $pValue;
 
  476        $this->shadow = $pValue;
 
  491            $this->worksheet->getHashCode() .
 
  498            $this->shadow->getHashCode() .
 
  508        $vars = get_object_vars($this);
 
  509        foreach ($vars as 
$key => $value) {
 
  510            if (
$key == 
'worksheet') {
 
  511                $this->worksheet = 
null;
 
  512            } elseif (is_object($value)) {
 
  513                $this->
$key = clone $value;
 
  515                $this->
$key = $value;
 
  522        $this->hyperlink = $pHyperlink;
 
An exception for terminatinating execution or to throw for unit testing.
getImageIndex()
Get image index.
setHyperlink(?Hyperlink $pHyperlink=null)
__construct()
Create a new BaseDrawing.
getCoordinates()
Get Coordinates.
setWidthAndHeight($width, $height)
Set width and height with proportional resize.
getHashCode()
Get hash code.
setHeight($pValue)
Set Height.
setShadow(?Drawing\Shadow $pValue=null)
Set Shadow.
setDescription($description)
Set Description.
setWorksheet(?Worksheet $pValue=null, $pOverrideOld=false)
Set Worksheet.
setResizeProportional($pValue)
Set ResizeProportional.
getResizeProportional()
Get ResizeProportional.
setWidth($pValue)
Set Width.
setOffsetY($pValue)
Set OffsetY.
setName($pValue)
Set Name.
getRotation()
Get Rotation.
getDescription()
Get Description.
setRotation($pValue)
Set Rotation.
getWorksheet()
Get Worksheet.
setOffsetX($pValue)
Set OffsetX.
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
setCoordinates($pValue)
Set Coordinates.