Footnote.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /**
  3. * This file is part of PHPWord - A pure PHP library for reading and writing
  4. * word processing documents.
  5. *
  6. * PHPWord is free software distributed under the terms of the GNU Lesser
  7. * General Public License version 3 as published by the Free Software Foundation.
  8. *
  9. * For the full copyright and license information, please read the LICENSE
  10. * file that was distributed with this source code. For the full list of
  11. * contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
  12. *
  13. * @see https://github.com/PHPOffice/PHPWord
  14. * @copyright 2010-2018 PHPWord contributors
  15. * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
  16. */
  17. namespace PhpOffice\PhpWord\Element;
  18. use PhpOffice\PhpWord\Style\Paragraph;
  19. class Footnote extends AbstractContainer
  20. {
  21. /**
  22. * @var string Container type
  23. */
  24. protected $container = 'Footnote';
  25. /**
  26. * Paragraph style
  27. *
  28. * @var string|\PhpOffice\PhpWord\Style\Paragraph
  29. */
  30. protected $paragraphStyle;
  31. /**
  32. * Is part of collection
  33. *
  34. * @var bool
  35. */
  36. protected $collectionRelation = true;
  37. /**
  38. * Create new instance
  39. *
  40. * @param string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
  41. */
  42. public function __construct($paragraphStyle = null)
  43. {
  44. $this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle);
  45. $this->setDocPart($this->container);
  46. }
  47. /**
  48. * Get paragraph style
  49. *
  50. * @return string|\PhpOffice\PhpWord\Style\Paragraph
  51. */
  52. public function getParagraphStyle()
  53. {
  54. return $this->paragraphStyle;
  55. }
  56. /**
  57. * Get Footnote Reference ID
  58. *
  59. * @deprecated 0.10.0
  60. * @codeCoverageIgnore
  61. *
  62. * @return int
  63. */
  64. public function getReferenceId()
  65. {
  66. return $this->getRelationId();
  67. }
  68. /**
  69. * Set Footnote Reference ID
  70. *
  71. * @deprecated 0.10.0
  72. * @codeCoverageIgnore
  73. *
  74. * @param int $rId
  75. */
  76. public function setReferenceId($rId)
  77. {
  78. $this->setRelationId($rId);
  79. }
  80. }