设置 SELECT-group 子句
@param string $group
@return $this
182089
public function setGroup($group)
    {
        if (!empty($group)) {
            $this->query['group'] = $group;
        } else {
            unset($this->query['group']);
        }
        return $this;
    }
682033
public function findByGroup(Group $group)
    {
        $query = $this->createQueryBuilder('a')
                      ->innerjoin('a.groups', 'g')
                      ->where('g.id = :group')
                      ->setParameter('group', $group->getId());
        return $query->getQuery()->getResult();
     }
504802
public function groupBy($groups)
    {
        $groups = (array) $groups;

        foreach ($groups as $group) {
            $this->groups = array_merge($this->groups, Arr::wrap($group));
        }

        return $this;
    }
1070295
public function addGroup(Group $group)
    {
        $this->hasGroupsProperty();

        if (!$this->groups->contains($group)) {
            $this->groups->add($group);
        }
    }
394137
protected function turnOnChildSelectionIfNeeded(&$group)
    {
        if ($group['selected'] == true) {
            foreach ($group['subjects'] as &$subject) {
                $subject['selected'] = true;
                if ($subject['subjects']) {
                    $this->turnOnChildSelectionIfNeeded($subject);
                }
            }
        }
    }
543687
public static function ungroup($group)
    {
        if (!static::isValidGroupId($group)) {
            return false;
        }
        $gateway_data             = GatewayProtocol::$empty;
        $gateway_data['cmd']      = GatewayProtocol::CMD_UNGROUP;
        $gateway_data['ext_data'] = $group;
        return static::sendToAllGateway($gateway_data);

    }
1212058
public function removeGroup(Group $group)
    {
        $this->hasGroupsProperty();

        if ($this->groups->contains($group)) {
            $this->groups->removeElement($group);
        }
    }
243244
protected function loadGlobal(/*# string */ $group)
    {
        if (!isset($GLOBALS[$group])) {
            $this->throwError(
                Message::get(Message::CONFIG_GLOBAL_UNKNOWN, $group),
                Message::CONFIG_GLOBAL_UNKNOWN
            );
        }

        // load super global
        $this->config->addNode($group, $GLOBALS[$group]);

        return $this;
    }
370782
protected function loadByGroup(/*# string */ $group)
    {
        // load super global
        if ('' !== $group && '_' === $group[0]) {
            return $this->loadGlobal($group);
        }

        // load from config
        $conf = $this->loader->load($group);

        foreach ($conf as $grp => $data) {
            $this->config->addNode($grp, $data);
        }

        return $this;
    }
158967
public function addGroup($group)
    {
        if (null === $this->groups) {
            $this->groups = [];
        }
        if (!in_array($group, $this->groups)) {
            $this->groups[] = $group;
        }

        return $this;
    }
718834
public function detachGroup(TagGroup $group)
    {
        if (!$this->hasGroup($tag)) {
            throw new OutOfBoundsException('Group '.$group->getName().' is not attached');
        }

        $this->_groups = array_filter($this->_groups, function ($knownGroup) use ($group) {
            return $group->getId() != $knownGroup->getId();
        });

        return $this;
    }
1287655
public function setOptions($options, $group = null)
    {
        if ($group) {
            $options = [$group => $options];
        }

        $this->handleOptions(null, $options);

        return $this;
    }
271873
public function group($group)
    {
        $group = $this->prepareNames(func_get_args(), false);
        $this->group = $group;
        return $this;
    }
1194291
public function setEditGroups( $groups )
    {
        $this->editGroups = array_unique(
            is_array( $groups ) ? $groups : preg_split( '/[,\s]+/', $groups )
        );

        return $this;
    }
591871
public function groupBy($group) 
    {
        
        $this->sql .= ' GROUP BY ';
        
        if(is_array($group)) {
            foreach($group as $column) {
                $this->sql .= $this->quoteColumnName($column) . ', ';
            }
            
            $this->sql = trim($this->sql, ', ');
        } else {
            $this->sql .= $this->quoteColumnName($group);
        }
        
        return $this;
    }
1040742
public function group($fieldGroup)
    {
        //====================================================================//
        // Safety Checks ==> Verify a new Field Exists
        if (empty($this->new)) {
            Splash::log()->err("ErrFieldsNoNew");
        } else {
            //====================================================================//
            // Update New Field structure
            $this->new->group = Splash::trans(trim($fieldGroup));
        }

        return $this;
    }
636676
public function removeGroup(ChildGroup $group)
    {
        if ($this->getGroups()->contains($group)) { $skillGroup = new ChildSkillGroup();

            $skillGroup->setGroup($group);
            if ($group->isSkillsLoaded()) {
                //remove the back reference if available
                $group->getSkills()->removeObject($this);
            }

            $skillGroup->setSkill($this);
            $this->removeSkillGroup(clone $skillGroup);
            $skillGroup->clear();

            $this->collGroups->remove($this->collGroups->search($group));

            if (null === $this->groupsScheduledForDeletion) {
                $this->groupsScheduledForDeletion = clone $this->collGroups;
                $this->groupsScheduledForDeletion->clear();
            }

            $this->groupsScheduledForDeletion->push($group);
        }


        return $this;
    }