本文整理汇总了PHP中Oro\Bundle\ConfigBundle\Config\ConfigManager::save方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigManager::save方法的具体用法?PHP ConfigManager::save怎么用?PHP ConfigManager::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\ConfigBundle\Config\ConfigManager
的用法示例。
在下文中一共展示了ConfigManager::save方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postAction
/**
* Set the current configuration
*
* @AclAncestor("oro_config_system")
*
* @return JsonResponse
*/
public function postAction(Request $request)
{
$this->configManager->save(json_decode($request->getContent(), true));
$data = json_decode($request->getContent(), true);
file_put_contents($this->getMessagesFilePath(), $data['pim_ui___loading_messages']['value']);
return $this->getAction();
}
示例2: testSave
public function testSave()
{
$data = [];
$this->userScopeManager->expects($this->once())->method('save')->with($data)->willReturn([[], []]);
$this->dispatcher->expects($this->once())->method('dispatch');
$this->userScopeManager->expects($this->once())->method('reload');
$this->manager->save($data);
}
示例3: testSave
public function testSave()
{
$data = [];
$this->userScopeManager->expects($this->once())->method('save')->with($data)->willReturn([[], []]);
$this->dispatcher->expects($this->exactly(2))->method('dispatch');
$this->dispatcher->expects($this->at(0))->method('dispatch')->with(ConfigSettingsUpdateEvent::BEFORE_SAVE, $this->isInstanceOf('Oro\\Bundle\\ConfigBundle\\Event\\ConfigSettingsUpdateEvent'));
$this->dispatcher->expects($this->at(1))->method('dispatch')->with(ConfigUpdateEvent::EVENT_NAME, $this->isInstanceOf('Oro\\Bundle\\ConfigBundle\\Event\\ConfigUpdateEvent'));
$this->userScopeManager->expects($this->once())->method('reload');
$this->userScopeManager->expects($this->once())->method('save')->with($data);
$this->manager->save($data);
}
示例4: process
/**
* Process form
*
* @param FormInterface $form
*
* @param Request $request
* @return bool True on successful processing, false otherwise
*/
public function process(FormInterface $form, Request $request)
{
$settingsData = $this->manager->getSettingsByForm($form);
$form->setData($settingsData);
if (in_array($request->getMethod(), array('POST', 'PUT'))) {
$form->submit($request);
if ($form->isValid()) {
$this->manager->save($form->getData());
return true;
}
}
return false;
}
示例5: testSave
public function testSave()
{
$data = ['oro_user___greeting' => ['value' => 'updated value', 'use_parent_scope_value' => false], 'oro_user___unknown' => ['value' => 'some value', 'use_parent_scope_value' => false], 'oro_user___level' => ['use_parent_scope_value' => true]];
$normalizedData = ['oro_user.greeting' => ['value' => 'updated value', 'use_parent_scope_value' => false], 'oro_user.level' => ['use_parent_scope_value' => true]];
$this->userScopeManager->expects($this->exactly(2))->method('getSettingValue')->willReturnMap([['oro_user.greeting', false, 'old value'], ['oro_user.level', false, 2000]]);
$beforeEvent = new ConfigSettingsUpdateEvent($this->manager, $normalizedData);
$afterEvent = new ConfigUpdateEvent(['oro_user.greeting' => ['old' => 'old value', 'new' => 'updated value'], 'oro_user.level' => ['old' => 2000, 'new' => 20]]);
$this->userScopeManager->expects($this->once())->method('save')->with($normalizedData)->willReturn([['oro_user.greeting' => 'updated value'], ['oro_user.level']]);
$this->dispatcher->expects($this->exactly(2))->method('dispatch');
$this->dispatcher->expects($this->at(0))->method('dispatch')->with(ConfigSettingsUpdateEvent::BEFORE_SAVE, $beforeEvent);
$this->dispatcher->expects($this->at(1))->method('dispatch')->with(ConfigUpdateEvent::EVENT_NAME, $afterEvent);
$this->manager->save($data);
}
示例6: postAction
/**
* Set the current configuration
*
* @AclAncestor("oro_config_system")
*
* @return JsonResponse
*/
public function postAction(Request $request)
{
$this->configManager->save(json_decode($request->getContent(), true));
return $this->getAction();
}