PHPWord/src/PhpWord/Element/Footer.php

65 lines
1.2 KiB
PHP
Raw Normal View History

2012-05-06 18:25:40 +02:00
<?php
/**
* PHPWord
2012-05-06 18:25:40 +02:00
*
2014-03-27 23:55:06 +07:00
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
2012-05-06 18:25:40 +02:00
*/
namespace PhpOffice\PhpWord\Container;
2013-12-16 06:40:30 -05:00
/**
* Footer element
*/
2014-03-31 23:10:51 +07:00
class Footer extends Container
{
2014-04-05 19:02:49 +07:00
const AUTO = 'default'; // default and odd pages
const FIRST = 'first';
const EVEN = 'even';
/**
* Header type
*
* @var string
*/
private $type = self::AUTO;
2013-12-16 06:40:30 -05:00
/**
2014-03-31 23:10:51 +07:00
* Create new instance
2013-12-16 06:40:30 -05:00
*
2014-03-31 23:10:51 +07:00
* @param int $sectionId
2014-04-05 19:02:49 +07:00
* @param int $footerId
* @param string $type
2013-12-16 06:40:30 -05:00
*/
2014-04-05 19:02:49 +07:00
public function __construct($sectionId, $footerId = 1, $type = self::AUTO)
2013-12-16 06:40:30 -05:00
{
$this->container = 'footer';
2014-04-05 19:02:49 +07:00
$this->sectionId = $sectionId;
$this->setType($type);
$this->setDocPart($this->container, ($sectionId - 1) * 3 + $footerId);
}
/**
* Set type
*
* @param string $value
* @since 0.9.2
*/
public function setType($value = self::AUTO)
{
$this->type = $value;
}
/**
* Get type
*
* @return string
* @since 0.9.2
*/
public function getType()
{
return $this->type;
}
}