src/app/n2n/impl/persistence/orm/property/relation/compare/ToManyCustomComparable.php
public function compareWithValue(QueryComparator $queryComparator, $operator, $value) {
		$this->validateOperator($operator);
		try {
			switch ($operator) {
				case CriteriaComparator::OPERATOR_CONTAINS:
				case CriteriaComparator::OPERATOR_CONTAINS_NOT:
					$this->typeConstraint->validate($value);
					break;
				case CriteriaComparator::OPERATOR_CONTAINS_ANY:
				case CriteriaComparator::OPERATOR_CONTAINS_NONE:
					TypeConstraint::createArrayLike(null, true, $this->typeConstraint)->validate($value);
			}
		} catch (ValueIncompatibleWithConstraintsException $e) {
			throw new CriteriaConflictException('Value can not be compared with property.', 0, $e);
		}
		
		if ($operator == CriteriaComparator::OPERATOR_CONTAINS) {
			$entityColumnComparable = $this->requestEntityColumnComparable();
			$queryComparator->match(
					$entityColumnComparable->buildQueryItem(CriteriaComparator::OPERATOR_EQUAL), 
					QueryComparator::OPERATOR_EQUAL,
					$entityColumnComparable->buildCounterpartQueryItemFromValue(
							CriteriaComparator::OPERATOR_EQUAL, $value));
			return;
		}
		
		if ($operator == CriteriaComparator::OPERATOR_CONTAINS_NOT) {
			$queryComparator->match(
					new QueryPlaceMarker($this->queryState->registerPlaceholderValue(
							$this->parseFieldValue($value)),
							QueryComparator::OPERATOR_IN, $this->requestToManyQueryItem()));
			return;
		}
		
		$entityColumnComparable = $this->requestEntityColumnComparable();
		$testQueryResult = $this->createTestQueryResult(
				$entityColumnComparable->buildCounterpartQueryItemFromValue(
						QueryComparator::OPERATOR_IN, $value));
		
		if ($operator == CriteriaComparator::OPERATOR_CONTAINS_ANY) {
			$queryComparator->test(QueryComparator::OPERATOR_EXISTS, $testQueryResult);
			return;
		}
		
		if ($operator == CriteriaComparator::OPERATOR_CONTAINS_NONE) {
			$queryComparator->test(QueryComparator::OPERATOR_NOT_EXISTS, $testQueryResult);
			return;
		}
	}
public function compareWithValue(QueryComparator $queryComparator, $operator, $value) {
		$this->validateOperator($operator);
		try {
			switch ($operator) {
				case CriteriaComparator::OPERATOR_CONTAINS:
				case CriteriaComparator::OPERATOR_CONTAINS_NOT:
					$this->typeConstraint->validate($value);
					break;
				case CriteriaComparator::OPERATOR_CONTAINS_ANY:
				case CriteriaComparator::OPERATOR_CONTAINS_NONE:
					TypeConstraint::createArrayLike(null, true, $this->typeConstraint)->validate($value);
			}
		} catch (ValueIncompatibleWithConstraintsException $e) {
			throw new CriteriaConflictException('Value can not be compared with property.', 0, $e);
		}
		
		if ($operator == CriteriaComparator::OPERATOR_CONTAINS) {
			$entityColumnComparable = $this->requestEntityColumnComparable();
			$queryComparator->match(
					$entityColumnComparable->buildQueryItem(CriteriaComparator::OPERATOR_EQUAL), 
					QueryComparator::OPERATOR_EQUAL,
					$entityColumnComparable->buildCounterpartQueryItemFromValue(
							CriteriaComparator::OPERATOR_EQUAL, $value));
			return;
		}
		
		if ($operator == CriteriaComparator::OPERATOR_CONTAINS_NOT) {
			$queryComparator->match(
					new QueryPlaceMarker($this->queryState->registerPlaceholderValue(
							$this->parseFieldValue($value)),
							QueryComparator::OPERATOR_IN, $this->requestToManyQueryItem()));
			return;
		}
		
		$entityColumnComparable = $this->requestEntityColumnComparable();
		$testQueryResult = $this->createTestQueryResult(
				$entityColumnComparable->buildCounterpartQueryItemFromValue(
						QueryComparator::OPERATOR_IN, $value));
		
		if ($operator == CriteriaComparator::OPERATOR_CONTAINS_ANY) {
			$queryComparator->test(QueryComparator::OPERATOR_EXISTS, $testQueryResult);
			return;
		}
		
		if ($operator == CriteriaComparator::OPERATOR_CONTAINS_NONE) {
			$queryComparator->test(QueryComparator::OPERATOR_NOT_EXISTS, $testQueryResult);
			return;
		}
	}
/* (non-PHPdoc)
@see \n2n\persistence\orm\criteria\compare\CustomComparable::compareWithValue()