示例#1
0
 /**
  * Transforms list to Array
  *
  * @return  Array Returns array
  */
 public function toArray()
 {
     $result = ObjectProperties::get($this);
     if (count($this->_properties) > 0) {
         foreach ($this->_properties as $property) {
             if (!empty($this->{$property})) {
                 $result[$property] = $this->{$property}->toArray();
             }
         }
     }
     return $result;
 }
示例#2
0
 /**
  * Transforms list to Array
  *
  * @return  Array Returns array
  */
 public function toArray()
 {
     $result = ObjectProperties::get($this);
     if (count($this->_properties) > 0) {
         foreach ($this->_properties as $property) {
             if ($this instanceof PaginationType) {
                 $result[$property] = $this->{$property};
             } else {
                 if (!empty($this->{$property})) {
                     if ($this->{$property} instanceof AbstractDataType || $this->{$property} instanceof AbstractListDataType) {
                         $result[$property] = $this->{$property}->toArray();
                     } else {
                         $result[$property] = $this->{$property};
                     }
                 }
             }
         }
     }
     return $result;
 }