Adds a target group to the entity.

@param TargetGroupInterface $targetGroup

@return self
327768
public function addTargetGroup(TargetGroupInterface $targetGroup)
    {
        $fileVersion = $this->getFileVersion();
        $fileVersion->addTargetGroup($targetGroup);

        return $this;
    }
1335670
public function addGroup(\Haven\SecurityBundle\Entity\Role $groups) {
        $this->groups[] = $groups;

        return $this;
    }
454778
public function addUserGroups(UserGroup ...$groups)
    {
        foreach ($groups as $group) {
            $this->getUserGroups()->add($group);
        }

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

        if (!$this->groups->contains($group)) {
            $this->groups->add($group);
        }
    }
344131
public function setGroup($group)
    {
        if (isset($this->options['group']) && $this->options['group']) {
            $group = $this->options['group'] . '/' . $group;
        }
        return $this->setOption('group', $group);
    }
557050
public function addGroup($group) {
    if (!$group->inArray((array) $this->groups)) {
      $this->groups[] = $group;
      return $this->groups;
    }
    return true;
  }
788808
public function addVariantGroup(VariantGroupInterface $variantGroup): ProductInterface
    {
        if (!$this->hasVariantGroup($variantGroup)) {
            $this->variantGroups->add($variantGroup);
        }

        return $this;
    }
645567
public function addAttributeGroup($attributeGroup)
    {
        $attributesGroups = $this->getAttributeGroups();
        array_push($attributesGroups, $attributeGroup);
        $this->setAttributeGroups($attributesGroups);
    }
984947
public function update(GroupInterface $group)
    {
        $this->em->persist($group);
        $this->em->flush();
        return true;

    }
308701
protected function addRoutes(GroupInterface $group): GroupInterface
    {
        $interfaceName = RoutesConfiguratorInterface::class;
        foreach ($this->selectClasses($this->getRoutesPath(), $interfaceName) as $routesConfClass) {
            /** @var RoutesConfiguratorInterface $routesConfClass */
            $routesConfClass::configureRoutes($group);
        }

        $interfaceName = ProvidesRouteConfiguratorsInterface::class;
        foreach ($this->selectClassImplements($this->getProviderClasses(), $interfaceName) as $providerClass) {
            /** @var ProvidesRouteConfiguratorsInterface $providerClass */
            foreach ($providerClass::getRouteConfigurators() as $routesConfClass) {
                /** @var RoutesConfiguratorInterface $routesConfClass */
                $routesConfClass::configureRoutes($group);
            }
        }

        return $group;
    }
1107702
public function add(CriterionInterface $criterion): self
    {
        if (! $criterion->isAttached()) {
            $criterion->attach($this);
        }

        $this->criteria[] = $criterion;

        return $this;
    }
457660
public function addGroup(Group $group)
    {
        $this->groups->put($group->getName(), $group);

        return $this;
    }
514020
public function targetGroupHitAction()
    {
        $currentTargetGroup = $this->targetGroupRepository->find($this->targetGroupStore->getTargetGroupId(true));

        $targetGroup = $this->targetGroupEvaluator->evaluate(TargetGroupRuleInterface::FREQUENCY_HIT, $currentTargetGroup);
        $response = new Response();

        if ($targetGroup) {
            $this->targetGroupStore->updateTargetGroupId($targetGroup->getId());
        }

        return $response;
    }
316835
public static function addGroupContent(NodeInterface $node, Group $group) {
    // TODO Check if group plugin id exists.
    $plugin_id = 'group_node:' . $node->bundle();
    $group->addContent($node, $plugin_id, ['uid' => $node->getOwnerId()]);
  }
549560
protected function addSite(FacadeInterface $facade, GroupInterface $group)
    {
        if ($this->hasGroup(CMSGroupContext::SITE) && $site = $group->getSite()) {
            $facade->site = $this->getContext()->transform('site', $site);
        }

        return $facade;
    }
1351789
public function addSerializerGroup($group)
    {
        if (is_array($group)) {
            $this->serializerGroups = array_merge(
                $this->serializerGroups,
                $group
            );
        } else {
            $this->serializerGroups[$group] = $group;
        }
    }
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;
    }