Exemple #1
0
 public function clear($name)
 {
     parent::clear($name);
     $data = $this->get('data');
     if (empty($data)) {
         $data = new \stdClass();
     }
     unset($data->{$name});
     $this->set('data', $data);
 }
Exemple #2
0
 public function toArray()
 {
     $data = parent::toArray();
     $childList = $this->get('childList');
     if (is_null($childList)) {
         $data['childList'] = null;
     } else {
         $arr = [];
         foreach ($childList as $entity) {
             $arr[] = $entity->toArray();
         }
         $data['childList'] = $arr;
     }
     return $data;
 }