public function handleSave(Form $form) { if ($form['recursively']->value) { $form->data->setPermissionRecursively(); } parent::handleSave($form); }
public function handleSave(Form $form) { if ($form['user']['password_new']->value) { $form->data->user->setPassword($form['user']['password']->value); } parent::handleSave($form); }
public function handleSave(Form $form) { $bank = $form['bank']->value; if ($bank && isset($form['drivers'][$bank->code])) { $form->data->options = $form['drivers'][$bank->code]->values; } parent::handleSave($form); }
public function handleSave(Form $form) { if ($this->user->isLoggedIn()) { $form->data->route->author = $this->user->identity; } else { $form->data->author = $form['author']->getValue(); } parent::handleSave($form); }
public function handleSave(Form $form) { /** @var $entity CategoryEntity */ $entity = $form->data; $data = $form->getValues(); $sort = json_decode($data['sort'], TRUE); foreach ($entity->getItems() as $photo) { if (($pos = array_search($photo->id, $sort)) !== false) { $photo->position = $pos; } } parent::handleSave($form); }
public function handleSave(Form $form) { /** @var $entity CategoryEntity */ $entity = $form->data; $data = $form->getValues(); foreach ($data['_photos'] as $fileEntity) { if ($fileEntity) { $entity->items[] = $photoEntity = new ItemEntity($form->data->extendedPage); $photoEntity->route->setPhoto($fileEntity); $photoEntity->route->setParent($entity->route); $photoEntity->setCategory($entity); } } parent::handleSave($form); }
public function handleSave(Form $form) { /** @var TagEntity $entity */ $entity = $form->data; $a = $entity->getLocale(); foreach ($this->getLanguageRepository()->findBy(array(), array('id' => 'ASC'), NULL, 1) as $language) { $entity->setLocale($language); if ($form['lang_' . $language->id]->value) { $entity->name = $form['languages'][$language->id]['name']->value; $entity->route->notation = $form['languages'][$language->id]['notation']->value; } else { $entity->name = NULL; $entity->route->notation = NULL; } } $entity->setLocale($a); $entity->name = $form['name']->value; $entity->route->notation = $form['notation']->value; parent::handleSave($form); }
protected function getControlExtensions() { return array_merge(parent::getControlExtensions(), array(new ControlExtension())); }
protected function getControlExtensions() { return array_merge(parent::getControlExtensions(), array(new \CmsModule\Content\ControlExtension(), new \FormsModule\ControlExtensions\ControlExtension(), new MailformExtension())); }
public function __construct(EntityMapper $mapper, TemplateManager $templateManager, $modules) { parent::__construct($mapper); $this->templateManager = $templateManager; $this->modules =& $modules; }
public function __construct(EntityMapper $mapper, ApiClientFactory $apiClientFactory) { parent::__construct($mapper); $this->apiClientFactory = $apiClientFactory; }
public function handleSave(Form $form) { $form->data->removeResetKey(); parent::handleSave($form); }
public function handleSave(Form $form) { if (!$form['gps']->value) { $form->data->latitude = NULL; $form->data->longitude = NULL; } parent::handleSave($form); }
public function handleSave(Form $form) { $form->data->page->published = $form->data->page->mainRoute->published; parent::handleSave($form); }
public function handleSave(Form $form) { if ($form->data->page->{$this->getSecuredColumnName()}) { /** @var ExtendedPageEntity $entity */ $entity = $form->data; $entity->getPage()->getPermissions()->clear(); $form->mapper->entityManager->flush($entity); if (isset($form->values['permissions'])) { foreach ($form->values['permissions'] as $key => $permission) { $class = $this->getPermissionEntityName(); $permissionEntity = new $class(); $permissionEntity->setName($key); $permissionEntity->setPage($entity->getPage()); $permissionEntity->setAll($permission['all']); foreach ($permission['permissions'] as $id) { $permissionEntity->roles[$id] = $this->getRoleRepository()->find($id); } $entity->getPage()->{$this->getPermissionColumnName()}[$key] = $permissionEntity; } } } parent::handleSave($form); }