本文整理汇总了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}'");
}
示例2: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
$method = $params->str('method');
$params = $params->arr('params');
TestManagerCaller::execute($method, $params);
return new AjaxSuccess();
}
示例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));
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
示例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());
}
示例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());
}
示例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();
}