2014-04-28 23:33:26 +07:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* PHPWord
|
|
|
|
|
*
|
|
|
|
|
* @link https://github.com/PHPOffice/PHPWord
|
2014-05-05 12:38:31 +04:00
|
|
|
* @copyright 2010-2014 PHPWord contributors
|
2014-05-04 21:03:28 +04:00
|
|
|
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace PhpOffice\PhpWord\Style;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Border style
|
|
|
|
|
*/
|
|
|
|
|
class Border extends AbstractStyle
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Border Top Size
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @var int|float
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
protected $borderTopSize;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Border Top Color
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $borderTopColor;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Border Left Size
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @var int|float
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
protected $borderLeftSize;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Border Left Color
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $borderLeftColor;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Border Right Size
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @var int|float
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
protected $borderRightSize;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Border Right Color
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $borderRightColor;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Border Bottom Size
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @var int|float
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
protected $borderBottomSize;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Border Bottom Color
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $borderBottomColor;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border size
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param int|float $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderSize($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->setBorderTopSize($value);
|
|
|
|
|
$this->setBorderLeftSize($value);
|
|
|
|
|
$this->setBorderRightSize($value);
|
|
|
|
|
$this->setBorderBottomSize($value);
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border size
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
2014-05-02 01:15:28 +07:00
|
|
|
* @return int[]
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderSize()
|
|
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
return array(
|
|
|
|
|
$this->getBorderTopSize(),
|
|
|
|
|
$this->getBorderLeftSize(),
|
|
|
|
|
$this->getBorderRightSize(),
|
|
|
|
|
$this->getBorderBottomSize(),
|
|
|
|
|
);
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border color
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param string $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderColor($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->setBorderTopColor($value);
|
|
|
|
|
$this->setBorderLeftColor($value);
|
|
|
|
|
$this->setBorderRightColor($value);
|
|
|
|
|
$this->setBorderBottomColor($value);
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border color
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
|
|
|
|
* @return string[]
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderColor()
|
|
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
return array(
|
|
|
|
|
$this->getBorderTopColor(),
|
|
|
|
|
$this->getBorderLeftColor(),
|
|
|
|
|
$this->getBorderRightColor(),
|
|
|
|
|
$this->getBorderBottomColor(),
|
|
|
|
|
);
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border top size
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param int|float $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderTopSize($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->borderTopSize = $value;
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border top size
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
|
|
|
|
* @return int|float
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderTopSize()
|
|
|
|
|
{
|
|
|
|
|
return $this->borderTopSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border top color
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param string $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderTopColor($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->borderTopColor = $value;
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border top color
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
|
|
|
|
* @return string
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderTopColor()
|
|
|
|
|
{
|
|
|
|
|
return $this->borderTopColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border left size
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param int|float $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderLeftSize($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->borderLeftSize = $value;
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border left size
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
|
|
|
|
* @return int|float
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderLeftSize()
|
|
|
|
|
{
|
|
|
|
|
return $this->borderLeftSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border left color
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param string $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderLeftColor($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->borderLeftColor = $value;
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border left color
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
|
|
|
|
* @return string
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderLeftColor()
|
|
|
|
|
{
|
|
|
|
|
return $this->borderLeftColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border right size
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param int|float $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderRightSize($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->borderRightSize = $value;
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border right size
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
|
|
|
|
* @return int|float
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderRightSize()
|
|
|
|
|
{
|
|
|
|
|
return $this->borderRightSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border right color
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param string $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderRightColor($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->borderRightColor = $value;
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border right color
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
|
|
|
|
* @return string
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderRightColor()
|
|
|
|
|
{
|
|
|
|
|
return $this->borderRightColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border bottom size
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param int|float $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderBottomSize($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->borderBottomSize = $value;
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border bottom size
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
|
|
|
|
* @return int|float
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderBottomSize()
|
|
|
|
|
{
|
|
|
|
|
return $this->borderBottomSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set border bottom color
|
|
|
|
|
*
|
2014-05-01 18:37:34 +07:00
|
|
|
* @param string $value
|
|
|
|
|
* @return self
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
2014-05-01 18:37:34 +07:00
|
|
|
public function setBorderBottomColor($value = null)
|
2014-04-28 23:33:26 +07:00
|
|
|
{
|
2014-05-01 18:37:34 +07:00
|
|
|
$this->borderBottomColor = $value;
|
|
|
|
|
|
|
|
|
|
return $this;
|
2014-04-28 23:33:26 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get border bottom color
|
2014-05-01 18:37:34 +07:00
|
|
|
*
|
|
|
|
|
* @return string
|
2014-04-28 23:33:26 +07:00
|
|
|
*/
|
|
|
|
|
public function getBorderBottomColor()
|
|
|
|
|
{
|
|
|
|
|
return $this->borderBottomColor;
|
|
|
|
|
}
|
|
|
|
|
}
|