1 | <?php |
||
29 | abstract class AssetsAbstract implements AssetsInterface |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * DOM tag name of asset item |
||
34 | * |
||
35 | * @var string $element_name |
||
36 | */ |
||
37 | protected $element_name = 'a-asset-item'; |
||
38 | |||
39 | /** |
||
40 | * ID attribute |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $attr_id; |
||
45 | |||
46 | /** |
||
47 | * SRC attribute |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $attr_src; |
||
52 | |||
53 | /** |
||
54 | * Asset constructor set asset ID |
||
55 | * |
||
56 | * @param string $id |
||
57 | */ |
||
58 | 5 | public function __construct(string $id) |
|
62 | |||
63 | /** |
||
64 | * Set ID attribute of the asset |
||
65 | * |
||
66 | * {@inheritdoc} |
||
67 | * |
||
68 | * @param string $id |
||
69 | */ |
||
70 | 5 | public function id(string $id = 'untitled') |
|
74 | |||
75 | /** |
||
76 | * Set Assets src attribute |
||
77 | * |
||
78 | * {@inheritdoc} |
||
79 | * |
||
80 | * @param null|string $src |
||
81 | * @return void |
||
82 | */ |
||
83 | 3 | public function src(string $src = null) |
|
87 | |||
88 | /** |
||
89 | * Create and add DOM element of the asset |
||
90 | * |
||
91 | * @param \DOMDocument $aframe_dom |
||
92 | * @return \DOMElement |
||
93 | */ |
||
94 | 2 | public function domElement(&$aframe_dom): DOMElement |
|
100 | } |
||
101 |