當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。