本文整理汇总了PHP中ArrayAdapter::int方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayAdapter::int方法的具体用法?PHP ArrayAdapter::int怎么用?PHP ArrayAdapter::int使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayAdapter
的用法示例。
在下文中一共展示了ArrayAdapter::int方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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();
}
示例3: 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}'");
}
示例4: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
$unique = $params->str(DiscussionController::JS_DATA_UNIQUE);
$upDown = $params->bool(DiscussionController::JS_DATA_UPDOWN);
$entity = $params->str(DiscussionController::JS_DATA_THREAD);
$theme = $params->str(self::JS_PARAM_THEME);
$comment = $params->str(self::JS_PARAM_COMMENT);
$parentId = $params->int(self::JS_PARAM_PARENT_ID);
$controller = Handlers::getInstance()->getDiscussionController($unique);
//Валидируем тему
if (!$parentId && $controller->getDiscussionSettings()->isThemed()) {
if (!$theme) {
return 'Введите тему';
}
$error = UserInputValidator::validateShortText($theme);
if ($error) {
return $error;
}
$theme = UserInputTools::safeShortText($theme);
}
//Валидируем комментарий
if (!$comment) {
return 'Введите комментарий';
}
$error = UserInputValidator::validateLongText($comment);
if ($error) {
return $error;
}
$comment = UserInputTools::safeLongText($comment);
$msgObj = $controller->saveMessage($entity, $parentId, $comment, $theme, PsUser::inst());
if (!$msgObj instanceof DiscussionMsg) {
return 'Ошибка добавления сообщения';
}
return new AjaxSuccess($controller->buildLeaf($msgObj));
}
示例5: doProcess
public function doProcess(ArrayAdapter $params)
{
$postId = $params->int('postId');
$postType = $params->str('postType');
$pp = Handlers::getInstance()->getPostsProcessorByPostType($postType);
$this->postCP = $pp->getPostContentProvider($postId);
}
示例6: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
$unique = $params->str(DiscussionController::JS_DATA_UNIQUE);
$upDown = $params->bool(DiscussionController::JS_DATA_UPDOWN);
$entity = $params->int(DiscussionController::JS_DATA_THREAD);
$action = $params->str(self::JS_PARAM_ACTION);
$msgId = $params->int(self::JS_PARAM_MSG_ID);
$rootId = $params->int(self::JS_PARAM_ROOT_ID);
$controller = Handlers::getInstance()->getDiscussionController($unique);
if (in_array($action, DiscussionController::getCommentActions())) {
return new AjaxSuccess($controller->executeCommentAction($msgId, $action));
}
if ($action == DiscussionController::TREE_ACTION_LOAD_COMMENTS) {
return new AjaxSuccess($controller->loadTree($rootId, $upDown, $entity));
}
return "Неизвестное действие: [{$action}]";
}
示例7: __construct
public function __construct($mandatory = true, $fileFormParam = FORM_PARAM_FILE)
{
if (!array_key_exists($fileFormParam, $_FILES)) {
check_condition(!$mandatory, "Ключ [{$fileFormParam}] не найден в массиве файлов");
return;
//---
}
$this->params = ArrayAdapter::inst($_FILES[$fileFormParam]);
$code = $this->params->int('error');
if (!$mandatory && $code == UPLOAD_ERR_NO_FILE) {
return;
//---
}
check_condition($code == UPLOAD_ERR_OK, $this->getErrorDescription($code));
$tmpName = $this->params->str('tmp_name');
check_condition(is_uploaded_file($tmpName), 'Файл не является загруженным');
$size = $this->params->int('size');
check_condition($size > 0 && $size <= UPLOAD_MAX_FILE_SIZE, "Недопустимый размер загружаемого файла: {$size} байт.");
$this->valid = true;
}
示例8: getPluginContent
public function getPluginContent($content, ArrayAdapter $params, PluginFetchingContext $ctxt)
{
$id = $params->int('id');
$name = $params->str('test_name');
$minutes = $params->int('time');
$tasksCnt = $ctxt->getTasksCount();
$result = null;
$testing = null;
if ($id) {
$testing = TestingBean::inst()->updateTestingState($id, $name, $tasksCnt, $minutes);
$result = TestingManager::getInstance()->getTestingResults($testing->getTestingId());
}
$tplData = $params->getData();
$tplData['testing'] = $testing;
$tplData['tasks'] = $content;
$tplData['results'] = $result;
$tplData['tasks_cnt'] = $tasksCnt;
$content = $this->getFoldedEntity()->fetchTpl($tplData);
$data = $testing ? $testing->getTestingId() : null;
return new PluginContent($content, $data);
}
示例9: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
$name = $params->str('name');
$type = $params->str('type');
$ident = $params->str('ident');
$rubId = $params->int('rubId');
check_condition($name, 'Name is empty');
$pp = Handlers::getInstance()->getPostsProcessorByPostType($type);
$pp->getFolding()->assertExistsEntity($ident);
AdminPostsBean::inst()->registerPost($pp->dbBean(), $ident, $name, $rubId);
return new AjaxSuccess();
}
示例10: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
$id = $params->int('id');
//feedId or userId - в зависимости от action
$action = $params->str('action');
$res = 'OK';
switch ($action) {
case 'delete':
AdminFeedbackBean::inst()->deleteAnonimMsg($id);
break;
case 'load':
//id = userId
$res = FeedbackManager::inst()->buildDiscussion(false, $id, false);
break;
default:
raise_error("Unknown action: {$action}");
}
return new AjaxSuccess($res);
}
示例11: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
$avatarId = $params->int('id');
//Может быть передан и PsConstJs::AVATAR_NO_SUFFIX, а значит - null
$action = $params->str('action');
$USER = PsUser::inst();
switch ($action) {
case 'set':
check_condition($USER->setAvatar($avatarId), 'Ошибка установки текущего аватара.');
break;
case 'del':
check_condition($USER->deteleAvatar($avatarId), 'Ошибка удаления аватара.');
break;
default:
raise_error("Неизвестное действие [{$action}].");
}
$result['id'] = $USER->hasAvatar() ? $USER->getAvatarId() : PsConstJs::AVATAR_NO_SUFFIX;
$result['src_big'] = $USER->getAvatarRelPath(PsUser::ID_CARD_AVATAR_DIM);
return new AjaxSuccess($result);
}
示例12: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
$action = $params->str('action');
$date = $params->int('date');
$res = array();
switch ($action) {
case 'search':
$res = AdminAuditTools::getAuditStatistic($date);
break;
case 'dump':
$where[] = Query::assocParam('dt_event', $date, true, '<=');
$order[] = 'dt_event asc';
$zipDi = AdminTableDump::dumpTable('id_rec', 'ps_audit', $where, $order);
check_condition($zipDi instanceof DirItem, 'Ошибка снятия дампа. Смотрите лог для деталей.');
$res['path'] = $zipDi->getAbsPath();
break;
case 'load-dumps':
$res['dumps'] = AP_APAudit::getInstance()->getAuditDumpsInfo();
break;
default:
raise_error("Unknown action: {$action}");
}
return new AjaxSuccess($res);
}
示例13: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
UtilsBean::inst()->removeMissprint($params->int('id'));
return new AjaxSuccess();
}
示例14: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
$post_id = $params->int('id');
TrainManager::inst()->toggleLessonState($post_id);
return new AjaxSuccess();
}
示例15: executeImpl
protected function executeImpl(ArrayAdapter $params)
{
$testingResId = $params->int('id');
TestingManager::getInstance()->dropTestingResults($testingResId);
return new AjaxSuccess();
}