public function edit($id = null)
    {
        $group = $this->UsersGroups->get($id);

        if ($this->request->is(['patch', 'post', 'put'])) {
            $group = $this->UsersGroups->patchEntity($group, $this->request->getData());

            if ($this->UsersGroups->save($group)) {
                $this->Flash->success(I18N_OPERATION_OK);

                return $this->redirect(['action' => 'index']);
            }

            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        $this->set(compact('group'));
    }