/** * <ul> * <li>By default the option is <i>OFF</i></li> * <li>The output when option is <i>ON</i> is this parameter name</li> * <li>The output when option is <i>OFF</i> is empty string</li> * <li>The parameter is not required</li> * </ul> * @param string $name The parameter name, case insensitive * @throws \MWException When $name not set */ public function __construct($name) { parent::__construct($name); $this->default_value = false; $this->output_on = $name; $this->output_off = ''; }
/** * <ul> * <li>The default value is 0</li> * <li>No minimal value</li> * <li>No maximal value</li> * <li>The parameter is not required</li> * </ul> * @param string $name The parameter name, case insensitive * @throws \MWException When $name not set */ public function __construct($name) { parent::__construct($name); $this->default_value = 0; $this->min = null; $this->max = null; }
/** * <ul> * <li>The default value is the empty string</li> * <li>HTML content is escaped for output.</li> * <li>No validation of the content of the value</li> * <li>Minimal length is 0 (accepts empty string)</li> * <li>Maximal length is 1024</li> * <li>The parameter is not required</li> * </ul> * * @param string $name The parameter name, case insensitive * @throws \MWException When $name not set */ public function __construct($name) { parent::__construct($name); $this->escape_mode = 'html'; $this->validate_type = 'all'; // validates everything $this->min_length = 0; // accepts empty string $this->max_length = 1024; }
/** * Constructor. * * @since 0.4 * * @param string $name * @param string $delimiter * @param mixed $type * @param mixed $default Use null for no default (which makes the parameter required) * @param array $aliases * @param array $criteria */ public function __construct($name, $delimiter = ListParameter::DEFAULT_DELIMITER, $type = Parameter::TYPE_STRING, $default = null, array $aliases = array(), array $criteria = array()) { $itemCriteria = array(); $listCriteria = array(); $this->cleanCriteria($criteria); foreach ($criteria as $criterion) { if ($criterion->isForLists()) { $listCriteria[] = $criterion; } else { $itemCriteria[] = $criterion; } } $this->listCriteria = $listCriteria; parent::__construct($name, $type, $default, $aliases, $itemCriteria); $this->delimiter = $delimiter; }
/** * @see ParameterTemplateParameterInterface::__construct() * @param integer $parameter_id */ function __construct($parameter_id) { parent::__construct($parameter_id); }
public function __construct(Parameter $parameter) { parent::__construct($parameter->getName(), $parameter->isRequired()); $this->parameter = $parameter; }
/** * <ul> * <li>The default value is boolean <i>false</i></li> * <li>The parameter is not required</li> * </ul> * @param string $name The parameter name, case insensitive * @throws \MWException When $name not set */ public function __construct($name) { parent::__construct($name); $this->default_value = false; }
/** * Constructor. */ public function __construct() { parent::__construct(array('required' => true, 'format' => true)); }
public function __construct($name, $class, $required = true) { parent::__construct($name, $required); $this->class = $class; }
/** * This parameter is a container for several sub-parameters. * Only one of these can be set by user (the XOR condition) * * Typical usage is for a "float" parameter, that contains options * "right" and "left". See Vimeo widget for example. * * <ul> * <li>The default value is the empty string</li> * <li>No default sub-parameter</li> * <li>The parameter is not required</li> * </ul> * * @param string $name The parameter name, case insensitive * @throws \MWException If $name not set */ public function __construct($name) { parent::__construct($name); $this->parameters = array(); $this->default_parameter = null; }