| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- /**
- * Class FormDataHandler
- * User: ThurData
- * Date: 2019-10-01
- * Time: 08:46
- * @package ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Traits
- */
- namespace ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Traits;
- /**
- * Trait FormDataHandler
- * @package ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Traits
- */
- trait FormDataHandler
- {
- /**
- * @var array
- */
- protected $formData = [];
- /**
- * @return array
- */
- public function getFormData()
- {
- return $this->formData;
- }
- /**
- * @param $formData
- * @return $this
- */
- public function setFormData($formData)
- {
- foreach($formData as $key => &$value)
- {
- $this->updateEntity($value);
- }
- $this->formData = $formData;
- return $this;
- }
- /**
- * @param null $entity
- */
- public function updateEntity(&$entity = null)
- {
- if(is_array($entity))
- {
- foreach ($entity as $key => &$value)
- {
- $this->updateEntity($value);
- }
- }elseif(is_object($entity))
- {
- }else{
- $entity = html_entity_decode($entity, ENT_QUOTES);
- }
- }
- }
|