Adds the group.

@param Group $group

@throws \InvalidArgumentException

@return Schema
186084
public function addGroup(Group $group)
    {
        if ($this->hasGroup($group)) {
            throw new \InvalidArgumentException(sprintf('Group "%s" is allready defined.', $group->getName()));
        }

        $this->groups[$group->getName()] = $group;

        return $this;
    }
496867
protected function addAccumulator($group, $definition) {
		$definition = trim($definition);
		
		if (! preg_match('/^([a-z]+)\s*\(\s*(.+)\s*\)$/i', $definition, $matches)) {
			throw new Exceptions\InvalidDefinition('Invalid definition: "' . $definition . '"');
		}
		
		$function = strtolower(trim($matches[1]));
		$property = trim($matches[2]);
		
		if (! in_array($function, static::$mongoAggregators, true)) {
			throw new Exceptions\InvalidDefinition('Invalid aggregate function: "' . $function . '"');
		}
		
		$this->_groupDefinition[$group] = ['$' . $function => '$' . $property];
	}
1192825
public function setGroup($group)
    {
        $this->group = $group instanceof SID ? $group : new SID($group);

        return $this;
    }
163824
public function addGroup(\TechPromux\DynamicQueryBundle\Entity\DataModelGroup $group)
    {
        $this->groups[] = $group;

        return $this;
    }
282757
public function group(...$groups)
    {
        foreach($groups as $item)
        {
            $group = new Group();
            $group->setValue($item);
            $this->option->group[] = $group;
        }
        return $this;
    }
1011669
public function addGroup(GroupInterface $group)
    {
        if (!$this->hasGroup($group)) {
            $this->groups->set($group->getName(), $group);
            $group->addUser($this);
        }

        return $this;
    }
1152896
public function addGroup(ChildGroup $group)
    {
        if ($this->collGroups === null) {
            $this->initGroups();
        }

        if (!$this->getGroups()->contains($group)) {
            // only add it if the **same** object is not already associated
            $this->collGroups->push($group);
            $this->doAddGroup($group);
        }

        return $this;
    }
1363200
public function addGroup($group)
    {
        if (is_string($group)) {
            // If the group is a string, we'll assume the dev is passing
            // in a DN string of the group. We'll try to locate it.
            $group = $this->query->newInstance()->findByDn($group);
        }

        if ($group instanceof Group) {
            // If the group is Group model instance, we can
            // add the current models DN to the group.
            return $group->addMember($this->getDn());
        }

        return false;
    }
1239855
public function addGroup(\Enhavo\Bundle\NewsletterBundle\Entity\Group $group)
    {
        $this->group[] = $group;

        return $this;
    }
581382
public function setGroup($group)
	{
	    if ($this->options['group']) {
	        $group = str_replace('//', '/', $this->options['group'] . '/' . $group);
	    }
	    
	    return $this->setOption('group', $group);
	}
158967
public function addGroup($group)
    {
        if (null === $this->groups) {
            $this->groups = [];
        }
        if (!in_array($group, $this->groups)) {
            $this->groups[] = $group;
        }

        return $this;
    }
661942
public function setGroup($group)
    {
        //Argument 1 must be a string or array
        Argument::i()->test(1, 'string', 'array');
            
        if (is_string($group)) {
            $group = array($group);
        }
        
        $this->group = $group;
        return $this;
    }
737839
public function addGroup(GroupInterface $group)
	{
		if ( ! $this->inGroup($group))
		{
			$this->add('groups', $group);
		}

		return true;
	}
1168198
public function getTabGroup(string $group): TabGroup
    {
        if (!isset($this->tabGroups[$group])) {
            throw new \InvalidArgumentException(sprintf('Requested group named "%s" is not found. Did you forget to tag the service?', $group));
        }

        return $this->tabGroups[$group];
    }
299622
public static function group(string $group): self
    {
        $item = new self();

        $item->group = $group;

        return $item;
    }
753742
public function setGroups($groups)
    {
        $this->hasGroupsProperty();

        $this->groups = $groups instanceof ArrayCollection ?
            $groups :
            new ArrayCollection($groups);
    }
742061
public function add($name, $field = null, $fieldset = null, $group = null)
    {
        if ($name instanceof AbstractField) {
            $field = $name;
        } else {
            if (is_string($field) && class_exists($field)) {
                $field = new $field();
            }

            if (!$field instanceof AbstractField) {
                throw new \InvalidArgumentException(__METHOD__ . ' argument 2 should be sub class of AbstractField.');
            }

            $field->setName($name);
        }

        return $this->addField($field, $fieldset, $group);
    }