/**
	 * Constructor.
	 * 
	 * You can specify the allowed values either by passing an array,
	 * or by passing each value as an argument. You can also specify
	 * if the criterion should care about capitalization or not by
	 * adding a boolean as last argument. This value default to false.
	 * 
	 * @since 0.4
	 */
	public function __construct() {
		parent::__construct();
		
		$args = func_get_args();
		
		$lastElement = array_pop( $args );
		
		if ( is_bool( $lastElement ) ) {
			// The element is a boolean, so it's the capitalization parameter.
			$this->careAboutCapitalization = $lastElement;
		}
		else {
			// Add the element back to the array.
			$args[] = $lastElement;
		}
		
		if ( count( $args ) > 1 ) {
			$this->allowedValues = $args; 
		}
		elseif ( count( $args ) == 1 )  {
			$this->allowedValues = (array)$args[0];
		}
		else {
			// Not a lot that will pass validation in this case :D
			$this->allowedValues = array();
		}
		
		if ( !$this->careAboutCapitalization ) {
			// If case doesn't matter, lowercase everything and later on compare a lowercased value.
			$this->allowedValues = array_map( 'strtolower', $this->allowedValues );
		}
	}
Exemplo n.º 2
0
 /**
  * Constructor
  *
  * @since 3.0
  */
 public function __construct()
 {
     parent::__construct();
 }
	/**
	 * Constructor.
	 * 
	 * @param string $pattern
	 * 
	 * @since 0.4
	 */
	public function __construct( $pattern ) {
		parent::__construct();
		
		$this->pattern = $pattern;
	}
Exemplo n.º 4
0
 /**
  * Constructor.
  * 
  * @param bool $hasToExist if set to true, the title has to be an existing one. If false, the name
  *        is just checked for validity within the wikis regulations.
  * 
  * @since 0.4.14
  */
 public function __construct($hasToExist = false)
 {
     $this->hasToExist = $hasToExist;
     parent::__construct();
 }
Exemplo n.º 5
0
 /**
  * Constructor.
  *
  * @since 0.7
  *
  * @param string $dimension
  */
 public function __construct($dimension)
 {
     parent::__construct();
     $this->dimension = $dimension;
 }
Exemplo n.º 6
0
 /**
  * Constructor.
  * 
  * @param mixed $lowerBound
  * @param mixed $upperBound
  * 
  * @since 0.4
  */
 public function __construct($lowerBound, $upperBound)
 {
     parent::__construct();
     $this->lowerBound = $lowerBound;
     $this->upperBound = $upperBound;
 }
Exemplo n.º 7
0
 /**
  * Constructor.
  * 
  * @param boolean $negativesAllowed since 0.4.8
  * 
  * @since 0.4
  */
 public function __construct($negativesAllowed = true)
 {
     $this->negativesAllowed = $negativesAllowed;
     parent::__construct();
 }
 /**
  * Constructor.
  * 
  * @since 0.7
  */
 public function __construct($metaDataSeparator = false)
 {
     parent::__construct();
     $this->metaDataSeparator = $metaDataSeparator;
 }
Exemplo n.º 9
0
 /**
  * Constructor.
  * 
  * @param integer $lowerBound False for no lower bound (since 0.4.8).
  * @param mixed $upperBound False for same value as lower bound. False for no upper bound (since 0.4.8).
  * 
  * @since 0.4
  */
 public function __construct($lowerBound, $upperBound = null)
 {
     parent::__construct();
     $this->lowerBound = $lowerBound;
     $this->upperBound = is_null($upperBound) ? $lowerBound : $upperBound;
 }
Exemplo n.º 10
0
 /**
  * Constructor.
  *
  * @param string $groupNameSeparator Separator between layer group and the
  *        layers name within the group.
  *
  * @since 0.7 (meaning of first param changed in 3.0)
  */
 public function __construct($groupNameSeparator = ';')
 {
     parent::__construct();
     $this->groupNameSep = $groupNameSeparator;
 }
Exemplo n.º 11
0
 /**
  * Constructor.
  * 
  * @since 0.7
  */
 public function __construct($service)
 {
     parent::__construct();
     $this->service = $service;
 }
Exemplo n.º 12
0
 /**
  * Constructor.
  * 
  * @since 0.7
  * 
  * @param array $overlayData
  */
 public function __construct(array $overlayData)
 {
     parent::__construct();
     $this->overlayData = $overlayData;
 }