| 1 |
<?php |
| 2 |
namespace YayMail\Elements; |
| 3 |
|
| 4 |
use YayMail\Abstracts\BaseElement; |
| 5 |
use YayMail\Constants\AttributesData; |
| 6 |
use YayMail\Utils\SingletonTrait; |
| 7 |
|
| 8 |
/** |
| 9 |
* Column Elements |
| 10 |
*/ |
| 11 |
class Column extends BaseElement { |
| 12 |
|
| 13 |
use SingletonTrait; |
| 14 |
|
| 15 |
protected static $type = 'column'; |
| 16 |
|
| 17 |
public $available_email_ids = [ YAYMAIL_ALL_EMAILS ]; |
| 18 |
|
| 19 |
public static function get_data( $width = 5, $attributes = [] ) { |
| 20 |
return [ |
| 21 |
'id' => uniqid(), |
| 22 |
'type' => self::$type, |
| 23 |
'group' => 'hidden', |
| 24 |
// only appears inside column_layout |
| 25 |
'available' => true, |
| 26 |
'children' => isset( $attributes['children'] ) ? $attributes['children'] : [], |
| 27 |
|
| 28 |
'data' => [ |
| 29 |
'width' => isset( $attributes['width'] ) ? $attributes['width'] : $width, |
| 30 |
'border' => isset( $attributes['border'] ) ? $attributes['border'] : AttributesData::BORDER_DEFAULT, |
| 31 |
], |
| 32 |
]; |
| 33 |
} |
| 34 |
} |
| 35 |
|