| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace ThurData\Servers\KerioEmail\App\Services\ConfigurableOptions\Abstracts;
- /**
- * Description of TypeConstans
- *
- * @autor ThurData <info@thurdata.ch>
- */
- abstract class AbstractSerialize
- {
- protected function prepareName($key, $name = null)
- {
- if (is_null($name))
- {
- return $key . "|" . $key;
- }
- return $key . "|" . $name;
- }
- public function toArray()
- {
- $out = [];
- foreach (get_class_vars(get_called_class()) as $property => $value)
- {
- if (!isset($this->{$property}))
- {
- continue;
- }
- if (is_object($this->$property) || is_array($this->$property))
- {
- continue;
- }
- else
- {
- $out[$property] = $this->{$property};
- }
- }
- return $out;
- }
- }
|