当前位置: 首页>>代码示例>>PHP>>正文


PHP ConfigManager::save方法代码示例

本文整理汇总了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();
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:14,代码来源:ConfigurationController.php

示例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);
 }
开发者ID:anyt,项目名称:platform,代码行数:8,代码来源:ConfigManagerTest.php

示例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);
 }
开发者ID:northdakota,项目名称:platform,代码行数:11,代码来源:ConfigManagerTest.php

示例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;
 }
开发者ID:xamin123,项目名称:platform,代码行数:21,代码来源:ConfigHandler.php

示例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);
 }
开发者ID:startupz,项目名称:platform-1,代码行数:13,代码来源:ConfigManagerTest.php

示例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();
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:12,代码来源:ConfigurationController.php


注:本文中的Oro\Bundle\ConfigBundle\Config\ConfigManager::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。