暂无描述

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. * @link https://github.com/PHPOffice/PHPWord
  14. * @copyright 2010-2014 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. /**
  20. * Footnote element
  21. */
  22. class Footnote extends AbstractContainer
  23. {
  24. /**
  25. * @var string Container type
  26. */
  27. protected $container = 'Footnote';
  28. /**
  29. * Paragraph style
  30. *
  31. * @var string|\PhpOffice\PhpWord\Style\Paragraph
  32. */
  33. protected $paragraphStyle;
  34. /**
  35. * Is part of collection
  36. *
  37. * @var bool
  38. */
  39. protected $collectionRelation = true;
  40. /**
  41. * Create new instance
  42. *
  43. * @param string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
  44. */
  45. public function __construct($paragraphStyle = null)
  46. {
  47. $this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle);
  48. $this->setDocPart($this->container);
  49. }
  50. /**
  51. * Get paragraph style
  52. *
  53. * @return string|\PhpOffice\PhpWord\Style\Paragraph
  54. */
  55. public function getParagraphStyle()
  56. {
  57. return $this->paragraphStyle;
  58. }
  59. /**
  60. * Get Footnote Reference ID
  61. *
  62. * @return int
  63. * @deprecated 0.10.0
  64. * @codeCoverageIgnore
  65. */
  66. public function getReferenceId()
  67. {
  68. return $this->getRelationId();
  69. }
  70. /**
  71. * Set Footnote Reference ID
  72. *
  73. * @param int $rId
  74. * @deprecated 0.10.0
  75. * @codeCoverageIgnore
  76. */
  77. public function setReferenceId($rId)
  78. {
  79. $this->setRelationId($rId);
  80. }
  81. }