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


PHP Enlight_Event_EventArgs::get方法代码示例

本文整理汇总了PHP中Enlight_Event_EventArgs::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Enlight_Event_EventArgs::get方法的具体用法?PHP Enlight_Event_EventArgs::get怎么用?PHP Enlight_Event_EventArgs::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Enlight_Event_EventArgs的用法示例。


在下文中一共展示了Enlight_Event_EventArgs::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onMyCustomRule

 /**
  * @param Enlight_Event_EventArgs $args
  * @return bool
  */
 public function onMyCustomRule(Enlight_Event_EventArgs $args)
 {
     $rule = $args->get('rule');
     $user = $args->get('user');
     $basket = $args->get('basket');
     $value = $args->get('value');
     if ($basket['AmountNumeric'] > $value) {
         return true;
         // it's a risky customer
     }
     return false;
 }
开发者ID:shobcheye,项目名称:devdocs,代码行数:16,代码来源:Bootstrap.php

示例2: onFilterCollectors

 public function onFilterCollectors(\Enlight_Event_EventArgs $arguments)
 {
     $collectors = $arguments->getReturn();
     $utils = $arguments->get('utils');
     foreach ($collectors as $key => $collector) {
         if ($collector instanceof EventCollector) {
             $collectors[$key] = new ClockworkEventCollector($arguments->get('eventManager'), $utils);
         } elseif ($collector instanceof TemplateCollector) {
             $collectors[$key] = new ClockworkTemplateCollector($this->container->get('template'), $utils, $this->container->get('kernel')->getRootDir());
         }
     }
     return $collectors;
 }
开发者ID:wesolowski,项目名称:shopware-clockwork,代码行数:13,代码来源:Debug.php

示例3: onSecureCheckoutConfirmPostDispatch

 public function onSecureCheckoutConfirmPostDispatch(Enlight_Event_EventArgs $arguments)
 {
     $controller = $arguments->get('subject');
     $view = $controller->View();
     $view->addTemplateDir($this->Path() . '/Views');
     $view->assign('number', $this->Config()->get('number'));
 }
开发者ID:kayyyy,项目名称:HostiConditions,代码行数:7,代码来源:Bootstrap.php

示例4: createS3Adapter

 /**
  * Creates adapter instance
  *
  * @param Enlight_Event_EventArgs $args
  * @return AdapterInterface
  */
 public function createS3Adapter(Enlight_Event_EventArgs $args)
 {
     $defaultConfig = ['key' => '', 'secret' => '', 'region' => '', 'version' => 'latest', 'bucket' => '', 'prefix' => ''];
     $config = array_merge($defaultConfig, $args->get('config'));
     $client = S3Client::factory(['credentials' => ['key' => $config['key'], 'secret' => $config['secret']], 'region' => $config['region'], 'version' => $config['version']]);
     return new AwsS3Adapter($client, $config['bucket'], $config['prefix']);
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:13,代码来源:Bootstrap.php

示例5: onPreDispatch

 /**
  * Called from the event manager before the dispatch process.
  * Parse the json input data, when it was activated.
  *
  * @param   Enlight_Event_EventArgs $args
  * @return  bool
  */
 public function onPreDispatch(Enlight_Event_EventArgs $args)
 {
     /** @var $subject Enlight_Controller_Action */
     $subject = $args->get('subject');
     $request = $subject->Request();
     // Parses the json input data, if the content type is correct
     if ($this->parseInput === true && ($contentType = $request->getHeader('Content-Type')) !== false && strpos($contentType, 'application/json') === 0 && ($input = file_get_contents('php://input')) !== false) {
         $input = Zend_Json::decode($input);
         foreach ((array) $input as $key => $value) {
             if ($value !== null) {
                 $request->setPost($key, $value);
             }
         }
     }
     // Parse the json Params
     if (count($this->parseParams)) {
         foreach ($this->parseParams as $Param) {
             if (($value = $request->getParam($Param)) !== null) {
                 $value = Zend_Json::decode($value);
                 $request->setParam($Param, $value);
             }
         }
     }
     // Rests the configuration for the next dispatch
     $this->parseInput = false;
     $this->parseParams = array();
 }
开发者ID:nvdnkpr,项目名称:Enlight,代码行数:34,代码来源:Bootstrap.php

示例6: onPostDispatch

 /**
  * Called from the Event Manager after the dispatch process
  *
  * @param Enlight_Event_EventArgs $args
  * @return bool
  */
 public function onPostDispatch(Enlight_Event_EventArgs $args)
 {
     /** @var $subject Enlight_Controller_Action */
     $subject = $args->get('subject');
     $response = $subject->Response();
     $request = $subject->Request();
     if (!$request->isDispatched()) {
         return;
     }
     // If the attribute padding is a boolean true
     if ($this->padding === true) {
         $this->padding = $request->getParam('callback');
         $this->padding = preg_replace('#[^0-9a-z_]+#i', '', (string) $this->padding);
     }
     // decide if we should render the data or the whole page
     if ($this->renderer === true) {
         $content = $subject->View()->getAssign();
     } elseif (!empty($this->padding)) {
         $content = $response->getBody();
     } else {
         return;
     }
     // Convert content to json
     $content = $this->convertToJson($content);
     if (!empty($this->padding)) {
         $response->setHeader('Content-type', 'text/javascript', true);
         $response->setBody($this->addPadding($content, $this->padding));
     } elseif ($this->renderer === true) {
         $response->setHeader('Content-type', 'application/json', true);
         $response->setBody($content);
     }
     $this->padding = null;
     $this->encoding = 'UTF-8';
     $this->renderer = null;
 }
开发者ID:nhp,项目名称:shopware-4,代码行数:41,代码来源:Bootstrap.php

示例7: onFrontendPostDispatch

 public function onFrontendPostDispatch(Enlight_Event_EventArgs $args)
 {
     $controller = $args->get('subject');
     $view = $controller->View();
     $view->addTemplateDir(__DIR__ . '/Views');
     $view->assign('facebookLink', $this->Config()->get('facebook-link'));
     $view->assign('twitterLink', $this->Config()->get('twitter-link'));
     $view->assign('emailLink', $this->Config()->get('email-link'));
 }
开发者ID:8mylezOrganization,项目名称:shopware-8mzSocialLinksFooter,代码行数:9,代码来源:Bootstrap.php

示例8: onFrontendPostDispatch

 public function onFrontendPostDispatch(Enlight_Event_EventArgs $args)
 {
     /** @var \Enlight_Controller_Action $controller */
     $controller = $args->get('subject');
     $view = $controller->View();
     $view->addTemplateDir(__DIR__ . '/Views');
     $view->assign('sloganSize', $this->Config()->get('font-size'));
     $view->assign('italic', $this->Config()->get('italic'));
     $view->assign('slogan', $this->getSlogan());
 }
开发者ID:shobcheye,项目名称:devdocs,代码行数:10,代码来源:Bootstrap.php

示例9: handleElement

 /**
  * Provide the store data for the current store.
  *
  * @param \Enlight_Event_EventArgs $args
  * @return array|mixed
  */
 public function handleElement(\Enlight_Event_EventArgs $args)
 {
     /** @var $controller \Enlight_Controller_Action */
     $controller = $args->get('subject');
     /** @var CustomComponents $customComponents */
     $customComponents = $controller->get('swag_dynamic_emotion.custom_components');
     $element = $args->get('element');
     $data = $args->getReturn();
     $storeId = $controller->Request()->getParam('currentStore');
     // just modify our own components
     if (!$customComponents->isCustomComponents($element['component']['cls'])) {
         return $data;
     }
     // if no $storeId is available (e.g. shopping world preview), get a fallback
     $storeId = isset($storeId) ? $storeId : Shopware()->Db()->fetchOne('SELECT id FROM swag_store LIMIT 1');
     // if still not available (e.g. no stores) - return
     if (!$storeId) {
         return $data;
     }
     /** @var ModelRepository $storeRepo */
     $storeRepo = Shopware()->Models()->getRepository('Shopware\\CustomModels\\SwagDynamicEmotion\\Store');
     return array_merge($data, ['store' => $storeRepo->find($storeId)]);
 }
开发者ID:shobcheye,项目名称:devdocs,代码行数:29,代码来源:Emotion.php

示例10: onShopwareStartDispatch

 public function onShopwareStartDispatch(Enlight_Event_EventArgs $args)
 {
     /** @var \Enlight_Controller_Front $subject */
     $subject = $args->get('subject');
     if ($subject->getParam('noErrorHandler')) {
         $requestUri = $subject->Request()->getRequestUri();
         if (file_exists($this->Path() . 'vendor/autoload.php')) {
             require_once $this->Path() . 'vendor/autoload.php';
         }
         $whoops = new Run();
         if ($subject->Request()->isXmlHttpRequest() || strstr($requestUri, '/backend') || strstr($requestUri, '/ajax')) {
             $whoops->pushHandler(new JsonResponseHandler());
         } else {
             $whoops->pushHandler(new PrettyPageHandler());
         }
         $whoops->register();
         restore_error_handler();
     }
 }
开发者ID:shyim,项目名称:adminer-for-shopware,代码行数:19,代码来源:Bootstrap.php

示例11: onDispatch

 /**
  * @param \Enlight_Event_EventArgs $args
  * @throws \Exception
  */
 public function onDispatch(\Enlight_Event_EventArgs $args)
 {
     /**@var $controller \Enlight_Controller_Action*/
     $controller = $args->get('subject');
     if (!$controller->View()) {
         return;
     }
     /**@var $shop Shop*/
     $shop = $this->container->get('shop');
     if ($shop->getTemplate()->getVersion() < 3) {
         return;
     }
     $templateManager = $this->container->get('template');
     $themeSettings = $templateManager->getTemplateVars('theme');
     if (!empty($themeSettings)) {
         return;
     }
     $inheritance = $this->container->get('theme_inheritance');
     $config = $inheritance->buildConfig($shop->getTemplate(), $shop, false);
     $templateManager->addPluginsDir($inheritance->getSmartyDirectories($shop->getTemplate()));
     $templateManager->assign('theme', $config);
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:26,代码来源:ConfigLoader.php

示例12: createSftpAdapter

 /**
  * Creates adapter instance
  *
  * @param Enlight_Event_EventArgs $args
  * @return AdapterInterface
  */
 public function createSftpAdapter(Enlight_Event_EventArgs $args)
 {
     $defaultConfig = ['host' => '', 'port' => 22, 'username' => '', 'password' => '', 'privateKey' => '', 'root' => '', 'timeout' => 10];
     $config = array_merge($defaultConfig, $args->get('config'));
     return new SftpAdapter(['host' => $config['host'], 'port' => $config['port'], 'username' => $config['username'], 'password' => $config['password'], 'privateKey' => $config['privateKey'], 'root' => $config['root'], 'timeout' => $config['timeout']]);
 }
开发者ID:k10r,项目名称:SwagMediaSftp,代码行数:12,代码来源:Bootstrap.php

示例13: validatePaymentContextData

 public function validatePaymentContextData(Enlight_Event_EventArgs $args)
 {
     $context = $args->get('context');
     $this->assertInternalType('array', $context['sPaymentTable']);
     $this->assertCount(0, $context['sPaymentTable']);
 }
开发者ID:ClaudioThomas,项目名称:shopware-4,代码行数:6,代码来源:sOrderTest.php

示例14: onOrderModelPostPersist

 /**
  * Stores the id of the created order into the plenty_order table
  *
  * @param Enlight_Event_EventArgs $arguments
  * @return boolean
  */
 public function onOrderModelPostPersist(Enlight_Event_EventArgs $arguments)
 {
     $model = $arguments->get('entity');
     $orderId = $model->getId();
     Shopware()->Db()->query('
 		INSERT INTO plenty_order
 			SET shopwareId = ?
 	', array($orderId));
     return true;
 }
开发者ID:Pfabeck,项目名称:plentymarkets-shopware-connector,代码行数:16,代码来源:Bootstrap.php

示例15: onUpdateSessionId

 /**
  * updates the session ID, if it changed
  *
  * @param \Enlight_Event_EventArgs $args
  */
 public function onUpdateSessionId(\Enlight_Event_EventArgs $args)
 {
     $this->sessionId = $args->get('newSessionId');
 }
开发者ID:Goucher,项目名称:shopware,代码行数:9,代码来源:Frontend.php


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