/** * Add image element * * @param string $src * @param mixed $style Image style * @param boolean $isWatermark * @return Image */ public function addImage($src, $style = null, $isWatermark = false) { $this->checkValidity('image'); $elementDocPart = $this->checkElementDocPart(); $image = new Image($src, $style, $isWatermark); $image->setDocPart($this->getDocPart(), $this->getDocPartId()); $rId = Media::addElement($elementDocPart, 'image', $src, $image); $image->setRelationId($rId); $this->addElement($image); return $image; }