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

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

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

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

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

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

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

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

        return $data;
    }
Convert object to array

@return array