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