_src = $src; $this->_isWatermark = $isWatermark; $this->_style = new PhpOffice\PhpWord\Style\Image(); if (!is_null($style) && is_array($style)) { foreach ($style as $key => $value) { if (substr($key, 0, 1) != '_') { $key = '_' . $key; } $this->_style->setStyleValue($key, $value); } } if (isset($style['wrappingStyle'])) { $this->_style->setWrappingStyle($style['wrappingStyle']); } if ($this->_style->getWidth() == null && $this->_style->getHeight() == null) { $imgData = getimagesize($this->_src); $this->_style->setWidth($imgData[0]); $this->_style->setHeight($imgData[1]); } } /** * Get Image style * * @return PhpOffice\PhpWord\Style\Image */ public function getStyle() { return $this->_style; } /** * Get Image Relation ID * * @return int */ public function getRelationId() { return $this->_rId; } /** * Set Image Relation ID * * @param int $rId */ public function setRelationId($rId) { $this->_rId = $rId; } /** * Get Image Source * * @return string */ public function getSource() { return $this->_src; } /** * Get Image Media ID * * @return string */ public function getMediaId() { return md5($this->_src); } /** * Get IsWatermark * * @return int */ public function getIsWatermark() { return $this->_isWatermark; } /** * Set IsWatermark * * @param bool $pValue */ public function setIsWatermark($pValue) { $this->_isWatermark = $pValue; } }