Sets the Model datetimepickerOptions.

@param  string|array $attr
@param  array $option = null

@return self
14833
public function setDateTimePickerOptions($attr, $option = null)
    {
        $options = is_array($attr)
            ? $attr
            : [$attr => $option];

        foreach ($options as $key => $value)
            $this->dateTimePickerOptions[$key] = $value;

        return $this;
    }
271222
public function setOption($option, $value)
    {
        if (array_key_exists($option, $this->options)) {
            $this->options[$option] = $value;
        }
        return $this;
    }
1106181
public function setElementsAttr($attr, $value) {
		foreach ($this->getElements() as $element) {
			if ($element instanceof Tag) {
				$element->setAttr($attr, $value);
			}
		}
		
		return $this;
	}
833861
public function attr(Array $attr = [])
    {
        if( isset($this->settings['attr']) && is_array($this->settings['attr']) )
        {
            $settings = $this->settings['attr'];
        }
        else
        {
            $settings = [];
        }

        $this->settings['attr'] = array_merge($settings, $attr);

        return $this;
    }
254690
public function setOption($option, $value)
    {
        $option                 = strtolower($option);
        $this->options[$option] = $value;
        return $this;
    }
306086
public function setAttribute( $attr, $value ) {
        //value is the text node
        //we add this for the sake of consistency amongst other form elements
        if( strtolower( $attr ) == 'value' ) {
           $this->setText( $value );
        } else {
            parent::setAttribute( $attr, $value );
        }
    }
461244
public function setActivatedAt($activated_at) {
        
        $this -> activated_at = $activated_at !== null ? new \DateTime($activated_at) : null;
        return $this;
    }
1151211
def datetime_field(attribute, options = {})
      value = object.send(attribute)
      data = { datepicker: "", timepicker: "" }
      data[:startdate] = I18n.localize(value, format: :decidim_short) if value.present? && value.is_a?(ActiveSupport::TimeWithZone)
      datepicker_format = ruby_format_to_datepicker(I18n.t("time.formats.decidim_short"))
      data[:"date-format"] = datepicker_format

      template = text_field(
        attribute,
        options.merge(data: data)
      )
      help_text = I18n.t("decidim.datepicker.help_text", datepicker_format: datepicker_format)
      template += error_and_help_text(attribute, options.merge(help_text: help_text))
      template.html_safe
    end
483438
public function setLocale(string $locale): DateTimePicker
    {
        $this->option_locale = $locale;
        $this->set_options['locale'] = 'locale';

        return $this;
    }
230481
public function setOption($option, $value)
    {
        switch ($option) {
            case FTPClient::TIMEOUT_SEC:
                if ($value <= 0) {
                    throw new Exception('Timeout value must be greater than zero');
                }
                break;

            case FTPClient::AUTOSEEK:
                if (!is_bool($value)) {
                    throw new Exception('Autoseek value must be boolean');
                }
                break;
            
            default:
                throw new Exception('Unsupported option');
                break;
        }

        return @ftp_set_option($this->connection, $option, $value);
    }
1179963
def set_datetime(self, section, option, value):
        
        self[section][option] = value.strftime(self.DATETIME_FMT)
102607
public function set_attribute($attr, $value = null)
	{
		$attr = is_array($attr) ? $attr : array($attr => $value);
		foreach ($attr as $key => $value)
		{
			if ($value === null)
			{
				unset($this->attributes[$key]);
			}
			else
			{
				$this->attributes[$key] = $value;
			}
		}

		return $this;
	}
135315
public function setRowAttributes($values, HtmlAttributes $attr)
    {
        $this->spec_row_values = $values;
        $this->spec_row_attr = $attr;

        return $this;
    }
311489
public function setAttribute($attr, $value)
    {

        $attr = strtolower($attr);

        if(is_null($value)) {
            unset($this->attributes[$attr]);
        }
        else {
            $this->attributes[$attr] = $value;
        }

        return $this;

    }
1075261
public function setMetadataAttr(string $attr, $value, array $options = [])
    {
        $this->getMetadata()->set($attr, $value, $options);

        return $this;
    }
1030619
public function addAttributes(array $attr)
    {
        foreach ($attr as $name => $value) {
            $this->setAttribute($name, $value);
        }

        return $this;
    }
528421
public function setTypesGroup($types, $attr = null)
    {
        if (! is_array($types))
            $types = [$types => $attr];

        foreach ($types as $type => $attrList) {
            if (! is_array($attrList))
                $attrList = [$attrList];

            foreach ($attrList as $attr)
                $this->inputType[$attr] = $type;
        }

        return $this;
    }