lib/eMapper/Result/Mapper/ComplexMapper.php
protected function validateGroup($group, $groupType) {
		if (is_null($this->resultMap)) {
			//find group column
			if (!array_key_exists($group, $this->columnTypes)) {
				if (is_numeric($group) && array_key_exists(intval($group), $this->columnTypes))
					$group = intval($group);
				else
					throw new \UnexpectedValueException("Group column '$group' not found");
			}
		
			//get group type
			$groupType = is_null($groupType) ? $this->columnTypes[$group] : $groupType;
			$groupColumn = $group;
		
			//obtain group type handler
			$groupTypeHandler = $this->typeManager->getTypeHandler($groupType);
		
			if ($groupTypeHandler === false)
				throw new \UnexpectedValueException("Unknown type '$groupType' defined for group '$group'");
		}
		else {
			//find group property
			if (!array_key_exists($group, $this->properties))
				throw new \UnexpectedValueException("Group property '$group' was not found in result map");
		
			//obtain group column and type handler
			$groupColumn = $this->properties[$group]->getColumn();
			$groupTypeHandler = $this->typeHandlers[$group];
		}
		
		return [$groupColumn, $groupTypeHandler];
	}
protected function validateGroup($group, $groupType) {
		if (is_null($this->resultMap)) {
			//find group column
			if (!array_key_exists($group, $this->columnTypes)) {
				if (is_numeric($group) && array_key_exists(intval($group), $this->columnTypes))
					$group = intval($group);
				else
					throw new \UnexpectedValueException("Group column '$group' not found");
			}
		
			//get group type
			$groupType = is_null($groupType) ? $this->columnTypes[$group] : $groupType;
			$groupColumn = $group;
		
			//obtain group type handler
			$groupTypeHandler = $this->typeManager->getTypeHandler($groupType);
		
			if ($groupTypeHandler === false)
				throw new \UnexpectedValueException("Unknown type '$groupType' defined for group '$group'");
		}
		else {
			//find group property
			if (!array_key_exists($group, $this->properties))
				throw new \UnexpectedValueException("Group property '$group' was not found in result map");
		
			//obtain group column and type handler
			$groupColumn = $this->properties[$group]->getColumn();
			$groupTypeHandler = $this->typeHandlers[$group];
		}
		
		return [$groupColumn, $groupTypeHandler];
	}
protected function validateGroup ( $ group , $ groupType ) { if ( is_null ( $ this -> resultMap ) ) { //find group column if ( ! array_key_exists ( $ group , $ this -> columnTypes ) ) { if ( is_numeric ( $ group ) && array_key_exists ( intval ( $ group ) , $ this -> columnTypes ) ) $ group = intval ( $ group ) ; else throw new \ UnexpectedValueException ( "Group column '$group' not found" ) ; } //get group type $ groupType = is_null ( $ groupType ) ? $ this -> columnTypes [ $ group ] : $ groupType ; $ groupColumn = $ group ; //obtain group type handler $ groupTypeHandler = $ this -> typeManager -> getTypeHandler ( $ groupType ) ; if ( $ groupTypeHandler === false ) throw new \ UnexpectedValueException ( "Unknown type '$groupType' defined for group '$group'" ) ; } else { //find group property if ( ! array_key_exists ( $ group , $ this -> properties ) ) throw new \ UnexpectedValueException ( "Group property '$group' was not found in result map" ) ; //obtain group column and type handler $ groupColumn = $ this -> properties [ $ group ] -> getColumn ( ) ; $ groupTypeHandler = $ this -> typeHandlers [ $ group ] ; } return [ $ groupColumn , $ groupTypeHandler ] ; }
Validates a user defined group against current result
@param string $group
@param string $groupType
@throws \UnexpectedValueException
@return array
Validates a user defined group against current result