|
|
@@ -36,11 +36,11 @@ abstract class AbstractElement
|
|
|
protected $phpWord;
|
|
|
|
|
|
/**
|
|
|
- * Section Id
|
|
|
+ * Section ID
|
|
|
*
|
|
|
* @var int
|
|
|
*/
|
|
|
- protected $sectionId;
|
|
|
+ protected $sectionID;
|
|
|
|
|
|
/**
|
|
|
* Document part type: Section|Header|Footer|Footnote|Endnote
|
|
|
@@ -54,15 +54,15 @@ abstract class AbstractElement
|
|
|
protected $docPart = 'Section';
|
|
|
|
|
|
/**
|
|
|
- * Document part Id
|
|
|
+ * Document part ID
|
|
|
*
|
|
|
- * For header and footer, this will be = ($sectionId - 1) * 3 + $index
|
|
|
+ * For header and footer, this will be = ($sectionID - 1) * 3 + $index
|
|
|
* because the max number of header/footer in every page is 3, i.e.
|
|
|
* AUTO, FIRST, and EVEN (AUTO = ODD)
|
|
|
*
|
|
|
* @var int
|
|
|
*/
|
|
|
- protected $docPartId = 1;
|
|
|
+ protected $docPartID = 1;
|
|
|
|
|
|
/**
|
|
|
* Index of element in the elements collection (start with 1)
|
|
|
@@ -72,18 +72,18 @@ abstract class AbstractElement
|
|
|
protected $elementIndex = 1;
|
|
|
|
|
|
/**
|
|
|
- * Unique Id for element
|
|
|
+ * Unique ID for element
|
|
|
*
|
|
|
* @var int
|
|
|
*/
|
|
|
- protected $elementId;
|
|
|
+ protected $elementID;
|
|
|
|
|
|
/**
|
|
|
- * Relation Id
|
|
|
+ * Relation ID
|
|
|
*
|
|
|
* @var int
|
|
|
*/
|
|
|
- protected $relationId;
|
|
|
+ protected $relationID;
|
|
|
|
|
|
/**
|
|
|
* Depth of table container nested level; Primarily used for RTF writer/reader
|
|
|
@@ -141,22 +141,22 @@ abstract class AbstractElement
|
|
|
*
|
|
|
* @return int
|
|
|
*/
|
|
|
- public function getSectionId()
|
|
|
+ public function getSectionID()
|
|
|
{
|
|
|
- return $this->sectionId;
|
|
|
+ return $this->sectionID;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Set doc part.
|
|
|
*
|
|
|
* @param string $docPart
|
|
|
- * @param int $docPartId
|
|
|
+ * @param int $docPartID
|
|
|
* @return void
|
|
|
*/
|
|
|
- public function setDocPart($docPart, $docPartId = 1)
|
|
|
+ public function setDocPart($docPart, $docPartID = 1)
|
|
|
{
|
|
|
$this->docPart = $docPart;
|
|
|
- $this->docPartId = $docPartId;
|
|
|
+ $this->docPartID = $docPartID;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -170,13 +170,13 @@ abstract class AbstractElement
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get doc part Id
|
|
|
+ * Get doc part ID
|
|
|
*
|
|
|
* @return int
|
|
|
*/
|
|
|
- public function getDocPartId()
|
|
|
+ public function getDocPartID()
|
|
|
{
|
|
|
- return $this->docPartId;
|
|
|
+ return $this->docPartID;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -188,7 +188,7 @@ abstract class AbstractElement
|
|
|
{
|
|
|
$mediaPart = $this->docPart;
|
|
|
if ($mediaPart == 'Header' || $mediaPart == 'Footer') {
|
|
|
- $mediaPart .= $this->docPartId;
|
|
|
+ $mediaPart .= $this->docPartID;
|
|
|
}
|
|
|
|
|
|
return strtolower($mediaPart);
|
|
|
@@ -220,9 +220,9 @@ abstract class AbstractElement
|
|
|
*
|
|
|
* @return string
|
|
|
*/
|
|
|
- public function getElementId()
|
|
|
+ public function getElementID()
|
|
|
{
|
|
|
- return $this->elementId;
|
|
|
+ return $this->elementID;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -230,30 +230,30 @@ abstract class AbstractElement
|
|
|
*
|
|
|
* @return void
|
|
|
*/
|
|
|
- public function setElementId()
|
|
|
+ public function setElementID()
|
|
|
{
|
|
|
- $this->elementId = substr(md5(rand()), 0, 6);
|
|
|
+ $this->elementID = substr(md5(rand()), 0, 6);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get relation Id
|
|
|
+ * Get relation ID
|
|
|
*
|
|
|
* @return int
|
|
|
*/
|
|
|
- public function getRelationId()
|
|
|
+ public function getRelationID()
|
|
|
{
|
|
|
- return $this->relationId;
|
|
|
+ return $this->relationID;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set relation Id.
|
|
|
+ * Set relation ID.
|
|
|
*
|
|
|
* @param int $value
|
|
|
* @return void
|
|
|
*/
|
|
|
- public function setRelationId($value)
|
|
|
+ public function setRelationID($value)
|
|
|
{
|
|
|
- $this->relationId = $value;
|
|
|
+ $this->relationID = $value;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -289,7 +289,7 @@ abstract class AbstractElement
|
|
|
|
|
|
// Set doc part
|
|
|
if (!$this instanceof Footnote) {
|
|
|
- $this->setDocPart($container->getDocPart(), $container->getDocPartId());
|
|
|
+ $this->setDocPart($container->getDocPart(), $container->getDocPartID());
|
|
|
}
|
|
|
|
|
|
$this->setMediaRelation();
|
|
|
@@ -297,7 +297,7 @@ abstract class AbstractElement
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set relation Id for media elements (link, image, object; legacy of OOXML)
|
|
|
+ * Set relation ID for media elements (link, image, object; legacy of OOXML)
|
|
|
*
|
|
|
* - Image element needs to be passed to Media object
|
|
|
* - Icon needs to be set for Object element
|
|
|
@@ -317,18 +317,18 @@ abstract class AbstractElement
|
|
|
if ($this instanceof Image) {
|
|
|
$image = $this;
|
|
|
}
|
|
|
- $rId = Media::addElement($mediaPart, strtolower($elementName), $source, $image);
|
|
|
- $this->setRelationId($rId);
|
|
|
+ $rID = Media::addElement($mediaPart, strtolower($elementName), $source, $image);
|
|
|
+ $this->setRelationID($rID);
|
|
|
|
|
|
if ($this instanceof Object) {
|
|
|
$icon = $this->getIcon();
|
|
|
- $rId = Media::addElement($mediaPart, 'image', $icon, new Image($icon));
|
|
|
- $this->setImageRelationId($rId);
|
|
|
+ $rID = Media::addElement($mediaPart, 'image', $icon, new Image($icon));
|
|
|
+ $this->setImageRelationID($rID);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set relation Id for elements that will be registered in the Collection subnamespaces.
|
|
|
+ * Set relation ID for elements that will be registered in the Collection subnamespaces.
|
|
|
*
|
|
|
* @return void
|
|
|
*/
|
|
|
@@ -337,8 +337,8 @@ abstract class AbstractElement
|
|
|
if ($this->collectionRelation === true && $this->phpWord instanceof PhpWord) {
|
|
|
$elementName = substr(get_class($this), strrpos(get_class($this), '\\') + 1);
|
|
|
$addMethod = "add{$elementName}";
|
|
|
- $rId = $this->phpWord->$addMethod($this);
|
|
|
- $this->setRelationId($rId);
|
|
|
+ $rID = $this->phpWord->$addMethod($this);
|
|
|
+ $this->setRelationID($rID);
|
|
|
}
|
|
|
}
|
|
|
|