Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function process(User $user)
 {
     $this->form->setData($user);
     if (in_array($this->request->getMethod(), array('POST', 'PUT'))) {
         $this->form->submit($this->request);
         if ($this->form->isValid()) {
             $businessUnits = $this->request->get('businessUnits', array());
             if ($businessUnits) {
                 $businessUnits = array_keys($businessUnits);
             }
             if ($this->businessUnitManager) {
                 $this->businessUnitManager->assignBusinessUnits($user, $businessUnits);
             }
             $this->onSuccess($user);
             return true;
         }
     }
     return false;
 }