public function group($group = null) {
		if (is_null($group))
			return $this->discard('query.group');
	
		if ($group instanceof Column) {
			//get referred attribute
			$map = $this->entityProfile->getPropertyMap();
			if (!in_array($group->getName(), $map))
				throw new \InvalidArgumentException(sprintf("Column '%s' is unknown for class '%s'", $group->getName(), $this->entityProfile->getReflectionClass()->getName()));
			$name = array_flip($map)[$group->getName()];
		}
		elseif ($group instanceof Attr)
			$name = $group->getName();
		elseif (is_string($group))
			$name = $group;
		else
			throw new \InvalidArgumentException("Group must be specified through an Attr instance or a valid property name");
		
		//get custom type (if any)
		$type = $group->getType();
		if (isset($type))
			return $this->merge(['query.group' => $group->getName() . ':' . $type]);
		return $this->merge(['query.group' => $group->getName()]);
	}