src/Action.php
public function toArray()
    {
        $data = array();

        $name = $this->getName();
        if ($name !== null) {
            $data['name'] = $name;
        }

        $title = $this->getTitle();
        if ($title !== null) {
            $data['title'] = $title;
        }

        $method = $this->getMethod();
        if ($method !== null) {
            $data['method'] = $method;
        }

        $href = $this->getHref();
        if ($href !== null) {
            $data['href'] = $href;
        }

        $type = $this->getType();
        if ($type !== null) {
            $data['type'] = $type;
        }

        $fields = $this->getFields();
        if (!empty($fields)) {
            $data['fields'] = array();
            foreach ($fields as $field) {
                $data['fields'][] = $field->toArray();
            }
        }

        return $data;
    }
public function toArray()
    {
        $data = array();

        $name = $this->getName();
        if ($name !== null) {
            $data['name'] = $name;
        }

        $title = $this->getTitle();
        if ($title !== null) {
            $data['title'] = $title;
        }

        $method = $this->getMethod();
        if ($method !== null) {
            $data['method'] = $method;
        }

        $href = $this->getHref();
        if ($href !== null) {
            $data['href'] = $href;
        }

        $type = $this->getType();
        if ($type !== null) {
            $data['type'] = $type;
        }

        $fields = $this->getFields();
        if (!empty($fields)) {
            $data['fields'] = array();
            foreach ($fields as $field) {
                $data['fields'][] = $field->toArray();
            }
        }

        return $data;
    }
Convert object to array

@return array