| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace ModulesGarden\Servers\ProxmoxVps\Core\UI\Builder;
- /**
- * Base Container element. Every UI element should extend this.
- *
- * @author inbs
- */
- class BaseContainer extends Context
- {
- protected $data = [];
- /**
- * @param array $data
- * @return $this
- */
- public function setData(array $data = [])
- {
- $this->data = $data;
- $this->updateData();
-
- return $this;
- }
- public function getData()
- {
- return $this->data;
- }
- protected function updateData()
- {
- foreach ($this->data as $key => $value)
- {
- if (property_exists($this, $key))
- {
- $this->$key = $value;
- }
- }
- $this->data = [];
-
- return $this;
- }
- }
|