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


PHP ArrayAdapter类代码示例

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


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

示例1: doProcess

 public function doProcess(ArrayAdapter $params)
 {
     $postId = $params->int('postId');
     $postType = $params->str('postType');
     $this->postCP = Handlers::getInstance()->getPostsProcessorByPostType($postType)->getPostContentProvider($postId);
     check_condition(!!$this->postCP, "Not found post with id='{$postId}' for post type='{$postType}'");
 }
开发者ID:ilivanoff,项目名称:www,代码行数:7,代码来源:postoriginalview.php

示例2: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $method = $params->str('method');
     $params = $params->arr('params');
     TestManagerCaller::execute($method, $params);
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:www,代码行数:7,代码来源:TestAction.php

示例3: default_values_are_returned_for_unavailable_configuration

 /**
  * @group configuration
  * @test
  */
 public function default_values_are_returned_for_unavailable_configuration()
 {
     $configuration = array('foo' => 'bar');
     $arrayAdapter = new ArrayAdapter($configuration);
     $this->assertNull($arrayAdapter->get('quuz'));
     $this->assertFalse($arrayAdapter->get('quux', false));
 }
开发者ID:SysBind,项目名称:saml2,代码行数:11,代码来源:ArrayAdapterTest.php

示例4: doProcess

 public function doProcess(ArrayAdapter $params)
 {
     $postId = $params->int('postId');
     $postType = $params->str('postType');
     $pp = Handlers::getInstance()->getPostsProcessorByPostType($postType);
     $this->postCP = $pp->getPostContentProvider($postId);
 }
开发者ID:ilivanoff,项目名称:www,代码行数:7,代码来源:print.php

示例5: registerStock

 /**
  * Метод, вызываемый блоком
  * {stock name='Мозайка' img='puzzle.png' ident='mosaic' to='2013-12-11 12:00:00' enabled='1' data_id='1'}
  * для регистрации акции
  * 
  * @param ArrayAdapter $params - параметры акции.
  */
 public function registerStock(ArrayAdapter $params)
 {
     $type = $params->str('type');
     if (!$this->existsEntity($type)) {
         return PsHtml::divErr("Неизвестный тип акции - [{$type}].");
     }
     /*
     * TODO - выкинута проверка доступа
      if (!$this->hasAccess($type)) {
      return '';
      }
     */
     /* @var $stock BaseStock */
     $stock = $this->getEntityClassInst($type, false);
     if (!$stock->isUserHasAccess()) {
         return '';
     }
     $stock->init($params);
     $type = $stock->getType();
     $ident = $stock->getStockIdent();
     if (array_key_exists($ident, $this->STOCKS)) {
         return PsHtml::divErr("Акция [{$stock}] уже зарегистрирована.");
     }
     $this->STOCKS[$ident] = $stock;
     $this->LOGGER->info("STOCK [{$stock}] is registered.");
     /*
      * Акция успешно зарегистрирована, покажем её "короткий" вид
      */
     $PARAMS['stock'] = $stock;
     $PARAMS['body'] = $stock->getShortView();
     return PSSmarty::template('common/stock.tpl', $PARAMS)->fetch();
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:39,代码来源:StockManager.php

示例6: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $action = $params->str('action');
     $gallery = $params->str('gallery');
     switch ($action) {
         case 'creategall':
             PsGallery::makeNew($gallery, $params->str('name'));
             break;
         case 'save':
             PsGallery::inst($gallery)->saveGallery($params->str('name'), $params->arr('images'));
             break;
         case 'imgadd':
             PsGallery::inst($gallery)->addWebImg($params->arr('img'));
             break;
         case 'imgdel':
             if ($params->bool('web')) {
                 PsGallery::inst($gallery)->deleteWebImg($params->str('file'));
             } else {
                 PsGallery::inst($gallery)->deleteLocalImg($params->str('file'));
             }
             break;
         default:
             json_error("Unknown action [{$action}].");
     }
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:www,代码行数:26,代码来源:GalleryAction.php

示例7: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $url = $params->str('url');
     $text = $params->str('text');
     $note = $params->str('note');
     if (!$url || !$text) {
         return 'Не передан url или текст';
     }
     /*
      * Если пользователь не просматривал эту страницу и это не администратор - игнорируем.
      */
     /*
      $wasOpened = PageOpenWatcher::isPageOpenedByUser($url, PsUser::instOrNull());
      if (!$wasOpened && !AuthManager::isAuthorizedAsAdmin()) {
      return 'Пользователь не открывал страницу'; //---
      }
     */
     $text = UserInputTools::safeShortText($text);
     $note = $note ? UserInputTools::safeLongText($note) : $note;
     $saved = UtilsBean::inst()->saveMisprint($url, $text, $note, AuthManager::getUserIdOrNull());
     if (!$saved) {
         return 'Запись не была сохранена';
         //---
     }
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:26,代码来源:Misprint.php

示例8: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $fav = $params->bool('fav');
     $type = $params->str('type');
     $ident = $params->str('ident');
     PopupPagesManager::inst()->toggleUserPopup($fav, $type, $ident);
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:www,代码行数:8,代码来源:PopupFavorites.php

示例9: fillTimeLineItem

 /**
  * Заполним ссылки на посты и, если передан параметр exists, удалим элементы, для которых нет постов.
  */
 protected function fillTimeLineItem(LibItemDb $libItem, TimeLineItem $tlItem, ArrayAdapter $params)
 {
     $post = BlogManager::inst()->getPostByIdent($libItem->getIdent(), false);
     if ($post) {
         $tlItem->setLink(BlogManager::inst()->postUrl($post));
     }
     return !$params->bool('exists') || !!$post;
 }
开发者ID:ilivanoff,项目名称:www,代码行数:11,代码来源:ScientistsManager.php

示例10: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $testingId = $params->int('id');
     $tasks = $params->arr('tasks');
     $time = $params->int('time');
     TestingManager::getInstance()->updateTestingResults($testingId, $time, $tasks);
     $pointsGiven = PL_testing::inst()->givePoints(PsUser::inst(), $testingId);
     return new AjaxSuccess($pointsGiven);
 }
开发者ID:ilivanoff,项目名称:www,代码行数:9,代码来源:TestingSave.php

示例11: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $id = $params->int('id');
     $uts = $params->int('date');
     $show = $params->bool('show');
     $type = $params->str('type');
     $pp = Handlers::getInstance()->getPostsProcessorByPostType($type);
     AdminPostsBean::inst()->updateState($pp->dbBean(), $id, $uts, $show);
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:www,代码行数:10,代码来源:PostActivateAction.php

示例12: givePointsByRequest

 /**
  * Метод пытается выдать очки пользователю на основе запроса к ajax {@link GivePointsCommon}
  */
 public function givePointsByRequest(PsUser $user, ArrayAdapter $request)
 {
     $fentity = Handlers::getInstance()->getFoldedEntityByUnique($request->str('fentity'));
     $class = $fentity->getClassInst();
     PsUtil::assertInstanceOf($class, 'PointsGiverRequest');
     $request->remove('fentity');
     $ctxt = new GivePointsContext($user->getId(), $fentity->getDbCode());
     $class->givePointsByRequest($ctxt, $request);
     return $this->checkGivePointsContext($user, $ctxt);
 }
开发者ID:ilivanoff,项目名称:www,代码行数:13,代码来源:UserPointsManager.php

示例13: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $ftype = $params->str('ftype');
     $fsubtype = $params->str('fsubtype');
     $fident = $params->str('fident');
     $zip = FoldedStorageInsts::byTypeStype($ftype, $fsubtype)->export2zip($fident);
     if (!$zip->isFile()) {
         return 'Не удалось создать архив';
     }
     return new AjaxSuccess($zip->getRelPath());
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:11,代码来源:ExportFoldingZip.php

示例14: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $ftype = $params->str('ftype');
     $fsubtype = $params->str('fsubtype');
     $fident = $params->str('fident');
     $zip = Handlers::getInstance()->getFolding($ftype, $fsubtype)->export2zip($fident);
     if (!$zip->isFile()) {
         return 'Не удалось создать архив';
     }
     return new AjaxSuccess($zip->getRelPath());
 }
开发者ID:ilivanoff,项目名称:www,代码行数:11,代码来源:ExportFoldingZip.php

示例15: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $action = $params->str('action');
     switch ($action) {
         case 'saveIni':
             ConfigIni::saveIniContent($params->str('scope'), $params->str('content'));
             break;
         default:
             raise_error("Неизвестный тип действия: [{$action}]");
     }
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:12,代码来源:ConfigFilesSave.php


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