@EXT\Route(
"/{model}/share/groups/add",
name="ws_share_groups_add",
options={"expose"=true}
)

@EXT\ParamConverter(
"groups",
class="ClarolineCoreBundle:Group",
options={"multipleIds"=true, "name"="groupIds"}
)
430607
public function shareGroupsAction(WorkspaceModel $model, array $groups)
    {
        $this->checkAccess($model->getWorkspace());
        $this->modelManager->addGroups($model, $groups);

        foreach ($groups as $group) {
            $data['groups'][] = array('id' => $group->getId(), 'name' => $group->getName());
        }

        $data['model']['id'] = $model->getId();

        return new JsonResponse($data);
    }
693916
public function orGroup()
    {
        $conditions = func_get_args();
        if (Collection::count($conditions) == 0) {
            throw new ErrorException('Missing arguments for orGroup() ');
        }
        //
        return $this->groupWhere($conditions[0], 'or', $conditions);
    }
852544
public function add(GroupCreationInformation $parameters)
    {
        $group = new Group($this->getContext(), $this->getResourcePath());
        $qry = new InvokePostMethodQuery($this->getResourcePath(),null,null, $parameters);
        $this->getContext()->addQuery($qry, $group);
        $this->addChild($group);
        return $group;
    }
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;
    }
841973
public function group($group, callable $callback, array $options = [])
    {
        $options = array_merge([
            'as' => $group,
            'namespace' => $group
        ], $options);

        if (is_array($group)) {
            foreach ($group as $k => $p) {
                $this->group($p, $callback, [
                    'as' => $options['as'][$k],
                    'namespace' => $options['namespace'][$k]
                ]);
            }
            return $this;
        }
        $this->setGroupAs($options['as']);
        $group = $this->removeDuplSlash($group . '/');
        $group = $this->namedParameters($group, true);

        $this->matched($this->prepare($group, false), false);

        $this->currentGroup = $group;
        // Add this group and sub-groups to append to route uri.
        $this->group .= $group;
        // Bind to Route Class.
//        $callback = $callback->bindTo($this);
        $callback = Closure::bind($callback, $this, get_class());
        // Call with args.
        call_user_func_array($callback, $this->bindArgs($this->pramsGroup, $this->matchedArgs));

        $this->isGroup = false;
        $this->pramsGroup = $this->pattGroup = [];
        $this->group = substr($this->group, 0, -strlen($group));
        $this->setGroupAs(substr($this->getGroupAs(), 0, -(strlen($options['as']) + 2)), true);

        return $this;
    }
347758
function addToGroup($group)
    {
        $this->_api->doRequest("PUT", "{$group->getBaseApiPath()}/contacts/{$this->id}");               
        $this->_group_ids_set[$group->id] = true;        
    }
359436
def group_add(self, name, restrict, repos, lces=[], assets=[], queries=[],
                  policies=[], dashboards=[], credentials=[], description=''):
        '''
        '''
        return self.raw_query('group', 'add', data={
            'lces': [{'id': i} for i in lces],
            'assets': [{'id': i} for i in assets],
            'queries': [{'id': i} for i in queries],
            'policies': [{'id': i} for i in policies],
            'dashboardTabs': [{'id': i} for i in dashboards],
            'credentials': [{'id': i} for i in credentials],
            'repositories': [{'id': i} for i in repos],
            'definingAssets': [{'id': i} for i in restrict],
            'name': name,
            'description': description,
            'users': [],
            'context': ''
        })
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;
    }
214314
public function group()
    {
        // Get arguments
        if (func_num_args() === 2) {
            list($prefix, $routes) = func_get_args();
            $filter = null;
        } elseif (func_num_args() === 3) {
            list($filter, $prefix, $routes) = func_get_args();
        }

        // Add leading slash to prefix if not present
        if (strncmp($prefix, '/', 1) !== 0) {
            $prefix = '/' . $prefix;
        }

        // Add trailing slash to prefix if not present
        if (substr($prefix, -1) !== '/') {
            $prefix .= '/';
        }

        // Register routes
        foreach ($routes as $route) {
            $type = $route[0];
            if ($type === 'resource') {
                $this->resource($prefix . $route[1], $route[2], $filter);
            } else {
                $this->register($type, $prefix . $route[1], $route[2], $filter);
            }
        }
    }
454778
public function addUserGroups(UserGroup ...$groups)
    {
        foreach ($groups as $group) {
            $this->getUserGroups()->add($group);
        }

        return $this;
    }
512259
protected function addgroup_media(){
		$this->registerGroup(BLang::_('ADMIN_CONFIG_SYSTEMS_MEDIA'),'media',array(
			new BConfigFieldPath(
				'MEDIA_PATH_ORIGINAL',
				BLang::_('ADMIN_CONFIG_SYSTEMS_MEDIA_PATH_ORIG'),
				BROOTPATH.'htdocs'.DIRECTORY_SEPARATOR.'media'.DIRECTORY_SEPARATOR.'original'
				),
			new BConfigFieldPath(
				'MEDIA_PATH_RESIZED',
				BLang::_('ADMIN_CONFIG_SYSTEMS_MEDIA_PATH_RESIZED'),
				BROOTPATH.'htdocs'.DIRECTORY_SEPARATOR.'media'.DIRECTORY_SEPARATOR.'resized'
				),
			new BConfigFieldString(
				'MEDIA_URL',
				BLang::_('ADMIN_CONFIG_SYSTEMS_MEDIA_URL'),
				'http://media.vidido.ua'
				),
			new BConfigFieldString(
				'MEDIA_TRUSTED_IMAGE_SIZES',
				BLang::_('ADMIN_CONFIG_SYSTEMS_MEDIA_TRUSTEDSIZES'),
				'127.0.0.1'
				),
			new BConfigFieldPath(
				'WATERMARK_PATH',
				'файл вотермарки',
				BROOTPATH.'htdocs'.DIRECTORY_SEPARATOR.'media'.DIRECTORY_SEPARATOR.'watermark.png'
				),
			new BConfigFieldList(
				'WATERMARK_POSITION',
				'Позиция вотермарки',
				array(
					1=>'лево верх',
					2=>'центр верх',
					3=>'право верх',
					4=>'лево центр',
					5=>'центр центр',
					6=>'право центр',
					7=>'лево низ',
					8=>'центр низ',
					9=>'право низ',
					)
				),
			new BConfigFieldInt(
				'WATERMARK_MINWIDTH',
				'минимальная ширина картинки для наложения',
				100
				),
			new BConfigFieldInt(
				'WATERMARK_MINHEIGHT',
				'минимальная высота картинки для наложения',
				100
				)
			));
		}
690315
public function &addGroup($unshift = false)
    {
        /* @var $group FormGroup */
        $group = $this->factory->create('FormDesigner\FormGroup');

        $this->elementFactory('group', $group, $unshift);

        $group->injectFormDesigner($this->fd);
        $group->injectParentGroup($this);

        return $group;
    }
1362210
public function editGroup()
	{
        $this->defaultData();

		$clazz = $this->getCurrentClass();
		$group = $this->getCurrentInstance();

		$formContainer = new SignedFormInstance($clazz, $group);
		$myForm = $formContainer->getForm();
		if($myForm->isSubmited()){
			if($myForm->isValid()){
			    $this->validateInstanceRoot($group->getUri());

				$binder = new tao_models_classes_dataBinding_GenerisFormDataBinder($group);
				$group = $binder->bind($myForm->getValues());

		        $this->setData("selectNode", tao_helpers_Uri::encode($group->getUri()));
				$this->setData('message', __('Group saved'));
				$this->setData('reload', true);
			}
		}

		$memberProperty = $this->getProperty(GroupsService::PROPERTY_MEMBERS_URI);
		$memberForm = tao_helpers_form_GenerisTreeForm::buildReverseTree($group, $memberProperty);
		$memberForm->setData('title',	__('Select group test takers'));
		$this->setData('memberForm', $memberForm->render());

		if ($this->getServiceLocator()->get(common_ext_ExtensionsManager::SERVICE_ID)->isEnabled('taoDeliveryRdf')) {
		    $this->setData('deliveryForm', DeliveryWidget::renderDeliveryTree($group));
		}
        $updatedAt = $this->getServiceLocator()->get(ResourceWatcher::SERVICE_ID)->getUpdatedAt($group);
		$this->setData('updatedAt', $updatedAt);
		$this->setData('formTitle', __('Edit group'));
		$this->setData('myForm', $myForm->render());
		$this->setView('form_group.tpl');
	}
806619
public function addItem(GroupItem $groupItem)
    {
        parent::addItem($groupItem);

        foreach($groupItem->getRefs() as $refField)
        {
            $ref_name = $refField->getName();

            $collection = $this->getSubCollection($ref_name, $refField->getRef());

            $collection->addItem($groupItem);
        }
    }
850661
public function sendCreateGroupMail( $group ) {

		$fromEmail	= $this->mailProperties->getSenderEmail();
		$fromName	= $this->mailProperties->getSenderName();

		$email = Yii::$app->factory->get( 'groupService' )->getEmail( $group );

		if( !empty( $email ) ) {

			// Send Mail
			$this->getMailer()->compose( self::MAIL_GROUP_CREATE, [ 'coreProperties' => $this->coreProperties, 'group' => $group, 'email' => $email ] )
				->setTo( $email )
				->setFrom( [ $fromEmail => $fromName ] )
				->setSubject( "Group Registration | " . $this->coreProperties->getSiteName() )
				//->setTextBody( "text" )
				->send();
		}
	}
514274
public function addPromotionGroup()
    {
        $aChosenGroup = $this->_getActionIds('oxgroups.oxid');
        $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
            $sGroupTable = $this->_getViewName('oxgroups');
            $aChosenGroup = $this->_getAll($this->_addFilter("select $sGroupTable.oxid " . $this->_getQuery()));
        }

        $promotionAdded = false;
        if ($soxId && $soxId != "-1" && is_array($aChosenGroup)) {
            foreach ($aChosenGroup as $sChosenGroup) {
                $oObject2Promotion = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
                $oObject2Promotion->init('oxobject2action');
                $oObject2Promotion->oxobject2action__oxactionid = new \OxidEsales\Eshop\Core\Field($soxId);
                $oObject2Promotion->oxobject2action__oxobjectid = new \OxidEsales\Eshop\Core\Field($sChosenGroup);
                $oObject2Promotion->oxobject2action__oxclass = new \OxidEsales\Eshop\Core\Field("oxgroups");
                $oObject2Promotion->save();
            }

            $promotionAdded = true;
        }

        return $promotionAdded;
    }
69266
public function addGroupAction(Request $request, $groupId)
    {
        $format = $request->get('_format', 'json');
        $facade = $this->get('jms_serializer')->deserialize(
            $request->getContent(),
            $this->getParameter('open_orchestra_user_admin.facade.user_collection.class'),
            $format
        );
        $users = $this->get('open_orchestra_api.transformer_manager')->get('user_collection')->reverseTransform($facade);
        $group =  $this->get('open_orchestra_user.repository.group')->find($groupId);

        $this->get('open_orchestra_user.repository.user')->addGroup($users, $group);

        return array();
    }