71 lines
1.3 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\Element;
2013-12-16 06:40:30 -05:00
use PhpOffice\PhpWord\Container\Container;
use PhpOffice\PhpWord\Style\Cell as CellStyle;
/**
* Table cell element
*/
class Cell extends Container
{
2013-12-16 06:40:30 -05:00
/**
* Cell width
2013-12-16 06:40:30 -05:00
*
* @var int
*/
private $width = null;
2013-12-16 06:40:30 -05:00
/**
* Cell style
2013-12-16 06:40:30 -05:00
*
* @var CellStyle
2013-12-16 06:40:30 -05:00
*/
private $cellStyle;
2013-12-16 06:40:30 -05:00
/**
* Create new instance
2013-12-16 06:40:30 -05:00
*
* @param string $docPart section|header|footer
* @param int $docPartId
2013-12-16 06:40:30 -05:00
* @param int $width
* @param array|CellStyle $style
2013-12-16 06:40:30 -05:00
*/
public function __construct($docPart, $docPartId, $width = null, $style = null)
2013-12-16 06:40:30 -05:00
{
$this->container = 'cell';
$this->docPart = $docPart;
$this->docPartId = $docPartId;
$this->width = $width;
2014-04-03 08:44:41 +07:00
$this->cellStyle = $this->setStyle(new CellStyle(), $style, true);
2013-12-16 06:40:30 -05:00
}
/**
* Get cell style
2013-12-16 06:40:30 -05:00
*
* @return CellStyle
2013-12-16 06:40:30 -05:00
*/
public function getStyle()
{
return $this->cellStyle;
2013-12-16 06:40:30 -05:00
}
/**
* Get cell width
2013-12-16 06:40:30 -05:00
*
* @return int
*/
public function getWidth()
{
return $this->width;
2013-12-16 06:40:30 -05:00
}
}