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


PHP Preconditions::checkNotNull方法代码示例

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


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

示例1: display

 /**
  * Generate a page content
  * @param Response $response response data to use to generate output
  * @return string Generated output to be sent to the browser
  */
 public function display(Response $response)
 {
     Preconditions::checkNotNull($response->getTemplate(), "Template not set");
     $templateName = 'pages/' . $response->getTemplate() . '.xhtml';
     $template = $this->twig->loadTemplate($templateName);
     $output = $template->render($response->getData());
     return $output;
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:13,代码来源:DisplayManager.php

示例2: invokeAction

 /**
  * Invoke an action given its name
  *
  * This function requests information necessary to operate on
  * VSES017 AIS application
  *
  * @param Trace $trace trace object
  * @param string $action action name
  * @param Context $context fajr context
  */
 public function invokeAction(Trace $trace, $action, Context $context)
 {
     Preconditions::checkIsString($action);
     $request = $context->getRequest();
     $response = $context->getResponse();
     $session = $context->getSessionStorage();
     Preconditions::checkNotNull($request);
     Preconditions::checkNotNull($response);
     Preconditions::checkNotNull($session);
     // check access to application
     $apps = $session->read('ais/aisApps');
     if (!is_array($apps)) {
         throw new Exception("Interná chyba - zoznam AIS aplikácii je nekorektný.");
     }
     if (!in_array(AIS2ApplicationEnum::ADMINISTRACIA_STUDIA, $apps)) {
         $response->setTemplate('studium/notAvailable');
         return;
     }
     $screenFactory = $this->factory;
     $adminStudia = $screenFactory->newAdministraciaStudiaScreen($trace);
     $this->administraciaStudiaScreen = $adminStudia;
     $this->studium = $request->getParameter('studium', '0');
     $this->zoznamStudii = $adminStudia->getZoznamStudii($trace->addChild("Get Zoznam Studii:"));
     $this->zapisneListy = $adminStudia->getZapisneListy($trace->addChild('getZapisneListy'), $this->studium);
     FajrUtils::warnWrongTableStructure($trace, $response, 'zoznam studii', regression\ZoznamStudiiRegression::get(), $this->zoznamStudii->getTableDefinition());
     FajrUtils::warnWrongTableStructure($trace, $response, 'zoznam zapisnych listov', regression\ZoznamZapisnychListovRegression::get(), $this->zapisneListy->getTableDefinition());
     $zapisneListyData = $this->zapisneListy->getData();
     if (count($zapisneListyData) == 0) {
         $this->zapisnyList = null;
         $this->terminyHodnoteniaScreen = null;
         $this->hodnoteniaScreen = null;
     } else {
         $this->zapisnyList = $request->getParameter('list');
         if ($this->zapisnyList === '') {
             $lastList = end($zapisneListyData);
             $this->zapisnyList = $lastList['index'];
         }
         $this->terminyHodnoteniaScreen = $screenFactory->newTerminyHodnoteniaScreen($trace, $adminStudia->getZapisnyListIdFromZapisnyListIndex($trace, $this->zapisnyList, VSES017\AdministraciaStudiaScreen::ACTION_TERMINY_HODNOTENIA), $adminStudia->getStudiumIdFromZapisnyListIndex($trace, $this->zapisnyList, VSES017\AdministraciaStudiaScreen::ACTION_TERMINY_HODNOTENIA));
         // FIXME: chceme to nejak refaktorovat, aby sme nevytvarali zbytocne
         // objekty, ktore v konstruktore robia requesty
         $this->hodnoteniaScreen = $screenFactory->newHodnoteniaPriemeryScreen($trace, $adminStudia->getZapisnyListIdFromZapisnyListIndex($trace, $this->zapisnyList, VSES017\AdministraciaStudiaScreen::ACTION_HODNOTENIA_PRIEMERY));
     }
     $response->set('zoznamStudii', $this->zoznamStudii);
     $response->set('studium', $this->studium);
     $response->set('zapisneListy', $this->zapisneListy);
     $response->set('zapisnyList', $this->zapisnyList);
     if (array_key_exists($action, $this->actionInfo)) {
         $info = $this->actionInfo[$action];
         if ($info['requiresZapisnyList'] && $this->zapisnyList == null) {
             $response->set('activeTab', $info['tabName']);
             $response->setTemplate('studium/chybaZapisnyList');
             return;
         }
     }
     parent::invokeAction($trace, $action, $context);
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:66,代码来源:StudiumController.php

示例3: display

 /**
  * Generate a page content
  *
  * @param Response $response response data to use to generate output
  *
  * @returns string Generated output to be sent to the browser
  */
 public function display(Response $response)
 {
     Preconditions::checkNotNull($response->getTemplate(), "Template not set");
     if ($response->getSkin()) {
         $skin = $response->getSkin();
     } else {
         $skin = $this->defaultSkin;
     }
     $twig = $this->twigFactory->provideTwigForSkin($skin);
     $templateName = 'pages/' . $response->getTemplate() . '.xhtml';
     $template = $twig->loadTemplate($templateName);
     $output = $template->render($response->getData());
     return $output;
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:21,代码来源:DisplayManager.php

示例4: invokeAction

 /**
  * Invoke an action given its name
  *
  * This function requests information necessary to operate on
  * VSST060 AIS application
  *
  * @param Trace $trace trace object
  * @param string $action action name
  * @param Context $context fajr context
  */
 public function invokeAction(Trace $trace, $action, Context $context)
 {
     Preconditions::checkIsString($action);
     $request = $context->getRequest();
     $response = $context->getResponse();
     $session = $context->getSessionStorage();
     Preconditions::checkNotNull($request);
     Preconditions::checkNotNull($response);
     Preconditions::checkNotNull($session);
     // check access to application
     $apps = $session->read('ais/aisApps');
     if (!is_array($apps)) {
         throw new Exception("Interná chyba - zoznam AIS aplikácii je nekorektný.");
     }
     if (!in_array(AIS2ApplicationEnum::REGISTER_PREDMETOV, $apps)) {
         $response->setTemplate('predmety/notAvailable');
         return;
     }
     $screenFactory = $this->factory;
     $register = $screenFactory->newRegisterPredmetovScreen($trace);
     $this->registerPredmetovScreen = $register;
     parent::invokeAction($trace, $action, $context);
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:33,代码来源:PredmetyController.php

示例5: testNullFail

 public function testNullFail()
 {
     $this->setExpectedException("InvalidArgumentException");
     $x = null;
     Preconditions::checkNotNull($x, "name");
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:6,代码来源:PreconditionsTest.php

示例6: newLoginUsingCookie

 /**
  * @param CosignServiceCookie $cookie
  * @returns AIS2Login
  */
 public function newLoginUsingCookie(CosignServiceCookie $cookie)
 {
     Preconditions::checkNotNull($cookie, 'cookie');
     return new TwoPhaseLogin(new CosignCookieLogin($cookie), new AIS2LoginImpl());
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:9,代码来源:LoginFactoryImpl.php

示例7: _getUrl

 /**
  * Return the full url for the specified path.
  *
  * @param string $path path to page
  *
  * @returns string fully qualified url.
  */
 private function _getUrl($path)
 {
     Preconditions::checkNotNull($path, "url path shouldn't be null.");
     Preconditions::checkIsString($path, "url path should be string.");
     return self::PROTOCOL . $this->serverName . '/' . $path;
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:13,代码来源:AIS2ServerUrlMap.php

示例8: __construct

 public function __construct(CosignServiceCookie $cookie)
 {
     Preconditions::checkNotNull($cookie, 'cookie');
     $this->cookie = $cookie;
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:5,代码来源:CosignCookieLogin.php


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