protected function _addCondition(array $condition) {
		$conditions = [];
		
		foreach ($condition as $key => $part) {
			if ($key === self::MONGO_OR) {
				if (isset($this->_conditions[self::MONGO_OR]) || isset($this->_conditions[self::MONGO_AND])) {
					// If the "$or" clause already exists, then converts it to the "$and" clause
					if (isset($this->_conditions[self::MONGO_OR])) {
						$mongoAnd = [
							[self::MONGO_OR => $this->_conditions[self::MONGO_OR]],
							[self::MONGO_OR => $part]
						];
						unset($this->_conditions[self::MONGO_OR]);
					}
					// Otherwise, just create the "$and" clause
					else {
						$mongoAnd = [[self::MONGO_OR => $part]];
					}
					
					// If the "$and" clause already exists, then merges it with the last clause
					if (isset($this->_conditions[self::MONGO_AND])) {
						$this->_conditions[self::MONGO_AND] = array_merge(
							$this->_conditions[self::MONGO_AND],
							$mongoAnd
						);
					}
					// Otherwise, put the created clause into the conditions
					else {
						$this->_conditions[self::MONGO_AND] = $mongoAnd;
					}
				} else {
					$conditions[$key] = $part;
				}
			} else {
				$conditions[$key] = $part;
			}
		}
		
		$this->_conditions = $conditions + $this->_conditions;
	}
protected function _addCondition(array $condition) {
		$conditions = [];
		
		foreach ($condition as $key => $part) {
			if ($key === self::MONGO_OR) {
				if (isset($this->_conditions[self::MONGO_OR]) || isset($this->_conditions[self::MONGO_AND])) {
					// If the "$or" clause already exists, then converts it to the "$and" clause
					if (isset($this->_conditions[self::MONGO_OR])) {
						$mongoAnd = [
							[self::MONGO_OR => $this->_conditions[self::MONGO_OR]],
							[self::MONGO_OR => $part]
						];
						unset($this->_conditions[self::MONGO_OR]);
					}
					// Otherwise, just create the "$and" clause
					else {
						$mongoAnd = [[self::MONGO_OR => $part]];
					}
					
					// If the "$and" clause already exists, then merges it with the last clause
					if (isset($this->_conditions[self::MONGO_AND])) {
						$this->_conditions[self::MONGO_AND] = array_merge(
							$this->_conditions[self::MONGO_AND],
							$mongoAnd
						);
					}
					// Otherwise, put the created clause into the conditions
					else {
						$this->_conditions[self::MONGO_AND] = $mongoAnd;
					}
				} else {
					$conditions[$key] = $part;
				}
			} else {
				$conditions[$key] = $part;
			}
		}
		
		$this->_conditions = $conditions + $this->_conditions;
	}
protected function _addCondition ( array $ condition ) { $ conditions = [ ] ; foreach ( $ condition as $ key => $ part ) { if ( $ key === self :: MONGO_OR ) { if ( isset ( $ this -> _conditions [ self :: MONGO_OR ] ) || isset ( $ this -> _conditions [ self :: MONGO_AND ] ) ) { // If the "$or" clause already exists, then converts it to the "$and" clause if ( isset ( $ this -> _conditions [ self :: MONGO_OR ] ) ) { $ mongoAnd = [ [ self :: MONGO_OR => $ this -> _conditions [ self :: MONGO_OR ] ] , [ self :: MONGO_OR => $ part ] ] ; unset ( $ this -> _conditions [ self :: MONGO_OR ] ) ; } // Otherwise, just create the "$and" clause else { $ mongoAnd = [ [ self :: MONGO_OR => $ part ] ] ; } // If the "$and" clause already exists, then merges it with the last clause if ( isset ( $ this -> _conditions [ self :: MONGO_AND ] ) ) { $ this -> _conditions [ self :: MONGO_AND ] = array_merge ( $ this -> _conditions [ self :: MONGO_AND ] , $ mongoAnd ) ; } // Otherwise, put the created clause into the conditions else { $ this -> _conditions [ self :: MONGO_AND ] = $ mongoAnd ; } } else { $ conditions [ $ key ] = $ part ; } } else { $ conditions [ $ key ] = $ part ; } } $ this -> _conditions = $ conditions + $ this -> _conditions ; }
Add the condition to the conditions' list

@param array $condition
Add the condition to the conditions list