| 1 | <?php |
||
| 10 | class Border |
||
| 11 | { |
||
| 12 | const LEFT = 'left'; |
||
| 13 | const RIGHT = 'right'; |
||
| 14 | const TOP = 'top'; |
||
| 15 | const BOTTOM = 'bottom'; |
||
| 16 | |||
| 17 | const STYLE_NONE = 'none'; |
||
| 18 | const STYLE_SOLID = 'solid'; |
||
| 19 | const STYLE_DASHED = 'dashed'; |
||
| 20 | const STYLE_DOTTED = 'dotted'; |
||
| 21 | const STYLE_DOUBLE = 'double'; |
||
| 22 | |||
| 23 | const WIDTH_THIN = 'thin'; |
||
| 24 | const WIDTH_MEDIUM = 'medium'; |
||
| 25 | const WIDTH_THICK = 'thick'; |
||
| 26 | |||
| 27 | /** @var array A list of BorderPart objects for this border. */ |
||
| 28 | private $parts = []; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param array|void $borderParts |
||
| 32 | */ |
||
| 33 | 13 | public function __construct(array $borderParts = []) |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @param string $name The name of the border part |
||
| 40 | * @return null|BorderPart |
||
| 41 | */ |
||
| 42 | 4 | public function getPart($name) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * @param string $name The name of the border part |
||
| 49 | * @return bool |
||
| 50 | */ |
||
| 51 | 4 | public function hasPart($name) |
|
| 55 | |||
| 56 | /** |
||
| 57 | * @return array |
||
| 58 | */ |
||
| 59 | 5 | public function getParts() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Set BorderParts |
||
| 66 | * @param array $parts |
||
| 67 | * @return void |
||
| 68 | */ |
||
| 69 | 13 | public function setParts($parts) |
|
| 76 | |||
| 77 | /** |
||
| 78 | * @param BorderPart $borderPart |
||
| 79 | * @return Border |
||
| 80 | */ |
||
| 81 | 13 | public function addPart(BorderPart $borderPart) |
|
| 86 | } |
||
| 87 |