public function toMap()

in php/src/Models/SearchResult.php [68:100]


    public function toMap()
    {
        $res = [];
        if (null !== $this->searchtime) {
            $res['searchtime'] = $this->searchtime;
        }
        if (null !== $this->total) {
            $res['total'] = $this->total;
        }
        if (null !== $this->viewtotal) {
            $res['viewtotal'] = $this->viewtotal;
        }
        if (null !== $this->num) {
            $res['num'] = $this->num;
        }
        if (null !== $this->items) {
            $res['items'] = [];
            if (null !== $this->items) {
                $res['items'] = $this->items;
            }
        }
        if (null !== $this->facet) {
            $res['facet'] = [];
            if (null !== $this->facet && \is_array($this->facet)) {
                $n = 0;
                foreach ($this->facet as $item) {
                    $res['facet'][$n++] = null !== $item ? $item->toMap() : $item;
                }
            }
        }

        return $res;
    }