public function merge($attributePreprocessors)
	{
		$error = false;

		if ($attributePreprocessors instanceof AttributePreprocessorCollection)
		{
			foreach ($attributePreprocessors as $attrName => $attributePreprocessor)
			{
				$this->add($attrName, $attributePreprocessor->getRegexp());
			}
		}
		elseif (is_array($attributePreprocessors))
		{
			// This should be a list where each element is a [attrName,regexp] pair, or
			// [attrName,AttributePreprocessor]
			foreach ($attributePreprocessors as $values)
			{
				if (!is_array($values))
				{
					$error = true;
					break;
				}

				list($attrName, $value) = $values;

				if ($value instanceof AttributePreprocessor)
				{
					$value = $value->getRegexp();
				}

				$this->add($attrName, $value);
			}
		}
		else
		{
			$error = true;
		}

		if ($error)
		{
			throw new InvalidArgumentException('merge() expects an instance of AttributePreprocessorCollection or a 2D array where each element is a [attribute name, regexp] pair');
		}
	}
public function merge($attributePreprocessors)
	{
		$error = false;

		if ($attributePreprocessors instanceof AttributePreprocessorCollection)
		{
			foreach ($attributePreprocessors as $attrName => $attributePreprocessor)
			{
				$this->add($attrName, $attributePreprocessor->getRegexp());
			}
		}
		elseif (is_array($attributePreprocessors))
		{
			// This should be a list where each element is a [attrName,regexp] pair, or
			// [attrName,AttributePreprocessor]
			foreach ($attributePreprocessors as $values)
			{
				if (!is_array($values))
				{
					$error = true;
					break;
				}

				list($attrName, $value) = $values;

				if ($value instanceof AttributePreprocessor)
				{
					$value = $value->getRegexp();
				}

				$this->add($attrName, $value);
			}
		}
		else
		{
			$error = true;
		}

		if ($error)
		{
			throw new InvalidArgumentException('merge() expects an instance of AttributePreprocessorCollection or a 2D array where each element is a [attribute name, regexp] pair');
		}
	}
public function merge ( $ attributePreprocessors ) { $ error = false ; if ( $ attributePreprocessors instanceof AttributePreprocessorCollection ) { foreach ( $ attributePreprocessors as $ attrName => $ attributePreprocessor ) { $ this -> add ( $ attrName , $ attributePreprocessor -> getRegexp ( ) ) ; } } elseif ( is_array ( $ attributePreprocessors ) ) { // This should be a list where each element is a [attrName,regexp] pair, or // [attrName,AttributePreprocessor] foreach ( $ attributePreprocessors as $ values ) { if ( ! is_array ( $ values ) ) { $ error = true ; break ; } list ( $ attrName , $ value ) = $ values ; if ( $ value instanceof AttributePreprocessor ) { $ value = $ value -> getRegexp ( ) ; } $ this -> add ( $ attrName , $ value ) ; } } else { $ error = true ; } if ( $ error ) { throw new InvalidArgumentException ( 'merge() expects an instance of AttributePreprocessorCollection or a 2D array where each element is a [attribute name, regexp] pair' ) ; } }
Merge a set of attribute preprocessors into this collection

@param array|AttributePreprocessorCollection $attributePreprocessors Instance of AttributePreprocessorCollection or 2D array of [[attrName,regexp|AttributePreprocessor]]
Merge a set of attribute preprocessors into this collection