name = (string) $name; $this->type = (string) $type; $this->label = (string) $label; $this->required = (bool) $required; $this->options = array_values( array_unique( array_map( 'strval', $options ) ) ); $this->provider_type = (string) $provider_type; } /** * Return the field name. * * @return string */ public function name() { return $this->name; } /** * Return the canonical type. * * @return string */ public function type() { return $this->type; } /** * Return the field label. * * @return string */ public function label() { return $this->label; } /** * Return whether the field is required. * * @return bool */ public function required() { return $this->required; } /** * Return enumerated values. * * @return string[] */ public function options() { return $this->options; } /** * Return the provider type. * * @return string */ public function provider_type() { return $this->provider_type; } /** * Perform the documented operation. * * @return array */ public function to_array() { return array( 'name' => $this->name, 'type' => $this->type, 'label' => $this->label, 'required' => $this->required, 'options' => $this->options, 'provider_type' => $this->provider_type, ); } }