本文整理汇总了PHP中Query::setLimit方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::setLimit方法的具体用法?PHP Query::setLimit怎么用?PHP Query::setLimit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Query
的用法示例。
在下文中一共展示了Query::setLimit方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
public static function getList($parameters = array())
{
$query = new Query(static::getEntity());
if (isset($parameters['select'])) {
$query->setSelect($parameters['select']);
} else {
$query->setSelect(array('*'));
}
if (isset($parameters['filter'])) {
$query->setFilter($parameters['filter']);
}
if (isset($parameters['group'])) {
$query->setGroup($parameters['group']);
}
if (isset($parameters['order'])) {
$query->setOrder($parameters['order']);
}
if (isset($parameters['limit'])) {
$query->setLimit($parameters['limit']);
}
if (isset($parameters['offset'])) {
$query->setOffset($parameters['offset']);
}
if (isset($parameters['count_total'])) {
$query->countTotal($parameters['count_total']);
}
if (isset($parameters['options'])) {
$query->setOptions($parameters['options']);
}
if (isset($parameters['runtime'])) {
foreach ($parameters['runtime'] as $name => $fieldInfo) {
$query->registerRuntimeField($name, $fieldInfo);
}
}
if (isset($parameters['data_doubling'])) {
$parameters['data_doubling'] ? $query->enableDataDoubling() : $query->disableDataDoubling();
}
return $query->exec();
// return array?
}
示例2: Query
}
$query = new Query();
$query->setQueryId("insertPoint");
$query->setAction("insert");
$query->setPriority("");
${'member_srl249_argument'} = new Argument('member_srl', $args->{'member_srl'});
${'member_srl249_argument'}->checkFilter('number');
${'member_srl249_argument'}->checkNotNull();
if (!${'member_srl249_argument'}->isValid()) {
return ${'member_srl249_argument'}->getErrorMessage();
}
if (${'member_srl249_argument'} !== null) {
${'member_srl249_argument'}->setColumnType('number');
}
${'point250_argument'} = new Argument('point', $args->{'point'});
${'point250_argument'}->checkFilter('number');
${'point250_argument'}->ensureDefaultValue('0');
${'point250_argument'}->checkNotNull();
if (!${'point250_argument'}->isValid()) {
return ${'point250_argument'}->getErrorMessage();
}
if (${'point250_argument'} !== null) {
${'point250_argument'}->setColumnType('number');
}
$query->setColumns(array(new InsertExpression('`member_srl`', ${'member_srl249_argument'}), new InsertExpression('`point`', ${'point250_argument'})));
$query->setTables(array(new Table('`xe_point`', '`point`')));
$query->setConditions(array());
$query->setGroups(array());
$query->setOrder(array());
$query->setLimit();
return $query;
示例3: fetchOne
public function fetchOne(Query $query)
{
$query->setLimit(1);
return $this->Query($query, true);
}
示例4: Query
$query = new Query();
$query->setQueryId("getLatestPackage");
$query->setAction("select");
$query->setPriority("");
${'page4_argument'} = new Argument('page', $args->{'page'});
${'page4_argument'}->ensureDefaultValue('1');
if (!${'page4_argument'}->isValid()) {
return ${'page4_argument'}->getErrorMessage();
}
${'page_count5_argument'} = new Argument('page_count', $args->{'page_count'});
${'page_count5_argument'}->ensureDefaultValue('10');
if (!${'page_count5_argument'}->isValid()) {
return ${'page_count5_argument'}->getErrorMessage();
}
${'list_count6_argument'} = new Argument('list_count', $args->{'list_count'});
${'list_count6_argument'}->ensureDefaultValue('1');
if (!${'list_count6_argument'}->isValid()) {
return ${'list_count6_argument'}->getErrorMessage();
}
${'sort_index3_argument'} = new Argument('sort_index', $args->{'sort_index'});
${'sort_index3_argument'}->ensureDefaultValue('updatedate');
if (!${'sort_index3_argument'}->isValid()) {
return ${'sort_index3_argument'}->getErrorMessage();
}
$query->setColumns(array(new StarExpression()));
$query->setTables(array(new Table('`xe_autoinstall_packages`', '`packages`')));
$query->setConditions(array());
$query->setGroups(array());
$query->setOrder(array(new OrderByColumn(${'sort_index3_argument'}, "desc")));
$query->setLimit(new Limit(${'list_count6_argument'}, ${'page4_argument'}, ${'page_count5_argument'}));
return $query;
开发者ID:einsss,项目名称:counsel_project,代码行数:31,代码来源:autoinstall.getLatestPackage.1.8.15.mysql_innodb.cache.php
示例5: ConditionArgument
}
if (isset($args->document_srl)) {
${'document_srl31_argument'} = new ConditionArgument('document_srl', $args->document_srl, 'equal');
${'document_srl31_argument'}->checkFilter('number');
${'document_srl31_argument'}->createConditionValue();
if (!${'document_srl31_argument'}->isValid()) {
return ${'document_srl31_argument'}->getErrorMessage();
}
} else {
${'document_srl31_argument'} = NULL;
}
if (${'document_srl31_argument'} !== null) {
${'document_srl31_argument'}->setColumnType('number');
}
${'list_count33_argument'} = new Argument('list_count', $args->{'list_count'});
${'list_count33_argument'}->ensureDefaultValue('20');
if (!${'list_count33_argument'}->isValid()) {
return ${'list_count33_argument'}->getErrorMessage();
}
${'sort_index32_argument'} = new Argument('sort_index', $args->{'sort_index'});
${'sort_index32_argument'}->ensureDefaultValue('list_order');
if (!${'sort_index32_argument'}->isValid()) {
return ${'sort_index32_argument'}->getErrorMessage();
}
$query->setColumns(array(new StarExpression()));
$query->setTables(array(new Table('`xe_comments`', '`comments`')));
$query->setConditions(array(new ConditionGroup(array(new ConditionWithArgument('`status`', $status29_argument, "equal", 'and'), new ConditionWithArgument('`module_srl`', $module_srl30_argument, "in", 'and'), new ConditionWithArgument('`document_srl`', $document_srl31_argument, "equal", 'and')))));
$query->setGroups(array());
$query->setOrder(array(new OrderByColumn(${'sort_index32_argument'}, "asc")));
$query->setLimit(new Limit(${'list_count33_argument'}));
return $query;
示例6: Argument
${'page35_argument'}->ensureDefaultValue('1');
if (!${'page35_argument'}->isValid()) {
return ${'page35_argument'}->getErrorMessage();
}
${'page_count36_argument'} = new Argument('page_count', $args->{'page_count'});
${'page_count36_argument'}->ensureDefaultValue('10');
if (!${'page_count36_argument'}->isValid()) {
return ${'page_count36_argument'}->getErrorMessage();
}
${'list_count37_argument'} = new Argument('list_count', $args->{'list_count'});
${'list_count37_argument'}->ensureDefaultValue('20');
if (!${'list_count37_argument'}->isValid()) {
return ${'list_count37_argument'}->getErrorMessage();
}
${'sort_index33_argument'} = new Argument('sort_index', $args->{'sort_index'});
${'sort_index33_argument'}->ensureDefaultValue('list_order');
if (!${'sort_index33_argument'}->isValid()) {
return ${'sort_index33_argument'}->getErrorMessage();
}
${'order_type34_argument'} = new SortArgument('order_type34', $args->order_type);
${'order_type34_argument'}->ensureDefaultValue('asc');
if (!${'order_type34_argument'}->isValid()) {
return ${'order_type34_argument'}->getErrorMessage();
}
$query->setColumns(array(new StarExpression()));
$query->setTables(array(new Table('`xe_documents`', '`documents`')));
$query->setConditions(array(new ConditionGroup(array(new ConditionWithArgument('`module_srl`', $module_srl5_argument, "in"), new ConditionWithArgument('`module_srl`', $exclude_module_srl6_argument, "notin", 'and'), new ConditionWithArgument('`category_srl`', $category_srl7_argument, "in", 'and'), new ConditionWithArgument('`is_notice`', $s_is_notice8_argument, "equal", 'and'), new ConditionWithArgument('`member_srl`', $member_srl9_argument, "equal", 'and'), new ConditionWithArgument('`status`', $statusList10_argument, "in", 'and'))), new ConditionGroup(array(new ConditionWithArgument('`list_order`', $division11_argument, "more", 'and'), new ConditionWithArgument('`list_order`', $last_division12_argument, "below", 'and')), 'and'), new ConditionGroup(array(new ConditionWithArgument('`title`', $s_title13_argument, "like"), new ConditionWithArgument('`content`', $s_content14_argument, "like", 'or'), new ConditionWithArgument('`user_name`', $s_user_name15_argument, "like", 'or'), new ConditionWithArgument('`user_id`', $s_user_id16_argument, "like", 'or'), new ConditionWithArgument('`nick_name`', $s_nick_name17_argument, "like", 'or'), new ConditionWithArgument('`email_address`', $s_email_address18_argument, "like", 'or'), new ConditionWithArgument('`homepage`', $s_homepage19_argument, "like", 'or'), new ConditionWithArgument('`tags`', $s_tags20_argument, "like", 'or'), new ConditionWithArgument('`member_srl`', $s_member_srl21_argument, "equal", 'or'), new ConditionWithArgument('`readed_count`', $s_readed_count22_argument, "more", 'or'), new ConditionWithArgument('`voted_count`', $s_voted_count23_argument, "more", 'or'), new ConditionWithArgument('`blamed_count`', $s_blamed_count24_argument, "less", 'or'), new ConditionWithArgument('`comment_count`', $s_comment_count25_argument, "more", 'or'), new ConditionWithArgument('`trackback_count`', $s_trackback_count26_argument, "more", 'or'), new ConditionWithArgument('`uploaded_count`', $s_uploaded_count27_argument, "more", 'or'), new ConditionWithArgument('`regdate`', $s_regdate28_argument, "like_prefix", 'or'), new ConditionWithArgument('`last_update`', $s_last_update29_argument, "like_prefix", 'or'), new ConditionWithArgument('`ipaddress`', $s_ipaddress30_argument, "like_prefix", 'or')), 'and'), new ConditionGroup(array(new ConditionWithArgument('`last_update`', $start_date31_argument, "more", 'and'), new ConditionWithArgument('`last_update`', $end_date32_argument, "less", 'and')), 'and')));
$query->setGroups(array());
$query->setOrder(array(new OrderByColumn(${'sort_index33_argument'}, $order_type34_argument)));
$query->setLimit(new Limit(${'list_count37_argument'}, ${'page35_argument'}, ${'page_count36_argument'}));
return $query;
示例7: Argument
${'page56_argument'}->ensureDefaultValue('1');
if (!${'page56_argument'}->isValid()) {
return ${'page56_argument'}->getErrorMessage();
}
${'page_count57_argument'} = new Argument('page_count', $args->{'page_count'});
${'page_count57_argument'}->ensureDefaultValue('10');
if (!${'page_count57_argument'}->isValid()) {
return ${'page_count57_argument'}->getErrorMessage();
}
${'list_count58_argument'} = new Argument('list_count', $args->{'list_count'});
${'list_count58_argument'}->ensureDefaultValue('20');
if (!${'list_count58_argument'}->isValid()) {
return ${'list_count58_argument'}->getErrorMessage();
}
${'sort_index54_argument'} = new Argument('sort_index', $args->{'sort_index'});
${'sort_index54_argument'}->ensureDefaultValue('list_order');
if (!${'sort_index54_argument'}->isValid()) {
return ${'sort_index54_argument'}->getErrorMessage();
}
${'sort_order55_argument'} = new SortArgument('sort_order55', $args->sort_order);
${'sort_order55_argument'}->ensureDefaultValue('asc');
if (!${'sort_order55_argument'}->isValid()) {
return ${'sort_order55_argument'}->getErrorMessage();
}
$query->setColumns(array(new StarExpression()));
$query->setTables(array(new Table('`xe_member`', '`member`')));
$query->setConditions(array(new ConditionGroup(array(new ConditionWithArgument('`is_admin`', $is_admin38_argument, "equal"), new ConditionWithArgument('`denied`', $is_denied39_argument, "equal", 'and'), new ConditionWithArgument('`member_srl`', $member_srls40_argument, "in", 'and'))), new ConditionGroup(array(new ConditionWithArgument('`user_id`', $s_user_id41_argument, "like"), new ConditionWithArgument('`user_name`', $s_user_name42_argument, "like", 'or'), new ConditionWithArgument('`nick_name`', $s_nick_name43_argument, "like", 'or'), new ConditionWithArgument('`nick_name`', $html_nick_name44_argument, "like", 'or'), new ConditionWithArgument('`email_address`', $s_email_address45_argument, "like", 'or'), new ConditionWithArgument('`birthday`', $s_birthday46_argument, "like", 'or'), new ConditionWithArgument('`extra_vars`', $s_extra_vars47_argument, "like", 'or'), new ConditionWithArgument('`regdate`', $s_regdate48_argument, "like_prefix", 'or'), new ConditionWithArgument('`last_login`', $s_last_login49_argument, "like_prefix", 'or'), new ConditionWithArgument('`member`.`regdate`', $s_regdate_more50_argument, "more", 'or'), new ConditionWithArgument('`member`.`regdate`', $s_regdate_less51_argument, "less", 'or'), new ConditionWithArgument('`member`.`last_login`', $s_last_login_more52_argument, "more", 'or'), new ConditionWithArgument('`member`.`last_login`', $s_last_login_less53_argument, "less", 'or')), 'and')));
$query->setGroups(array());
$query->setOrder(array(new OrderByColumn(${'sort_index54_argument'}, $sort_order55_argument)));
$query->setLimit(new Limit(${'list_count58_argument'}, ${'page56_argument'}, ${'page_count57_argument'}));
return $query;
示例8: Argument
${'page7_argument'}->ensureDefaultValue('1');
if (!${'page7_argument'}->isValid()) {
return ${'page7_argument'}->getErrorMessage();
}
${'page_count8_argument'} = new Argument('page_count', $args->{'page_count'});
${'page_count8_argument'}->ensureDefaultValue('10');
if (!${'page_count8_argument'}->isValid()) {
return ${'page_count8_argument'}->getErrorMessage();
}
${'list_count9_argument'} = new Argument('list_count', $args->{'list_count'});
${'list_count9_argument'}->ensureDefaultValue('20');
if (!${'list_count9_argument'}->isValid()) {
return ${'list_count9_argument'}->getErrorMessage();
}
${'sort_index5_argument'} = new Argument('sort_index', $args->{'sort_index'});
${'sort_index5_argument'}->ensureDefaultValue('list_order');
if (!${'sort_index5_argument'}->isValid()) {
return ${'sort_index5_argument'}->getErrorMessage();
}
${'order_type6_argument'} = new SortArgument('order_type6', $args->order_type);
${'order_type6_argument'}->ensureDefaultValue('asc');
if (!${'order_type6_argument'}->isValid()) {
return ${'order_type6_argument'}->getErrorMessage();
}
$query->setColumns(array(new SelectExpression('`name`'), new SelectExpression('`value`')));
$query->setTables(array(new Table('`xe_lang`', '`lang`')));
$query->setConditions(array(new ConditionGroup(array(new ConditionWithArgument('`site_srl`', $site_srl1_argument, "equal"), new ConditionWithArgument('`lang_code`', $langCode2_argument, "in", 'and'), new ConditionWithArgument('`value`', $search_keyword3_argument, "like", 'and'), new ConditionWithArgument('`name`', $name4_argument, "equal", 'and')))));
$query->setGroups(array());
$query->setOrder(array(new OrderByColumn(${'sort_index5_argument'}, $order_type6_argument)));
$query->setLimit(new Limit(${'list_count9_argument'}, ${'page7_argument'}, ${'page_count8_argument'}));
return $query;
开发者ID:einsss,项目名称:counsel_project,代码行数:31,代码来源:module.getLangListByLangcode.1.8.15.mysql_innodb.cache.php
示例9: Argument
${'page59_argument'}->ensureDefaultValue('1');
if (!${'page59_argument'}->isValid()) {
return ${'page59_argument'}->getErrorMessage();
}
${'page_count60_argument'} = new Argument('page_count', $args->{'page_count'});
${'page_count60_argument'}->ensureDefaultValue('10');
if (!${'page_count60_argument'}->isValid()) {
return ${'page_count60_argument'}->getErrorMessage();
}
${'list_count61_argument'} = new Argument('list_count', $args->{'list_count'});
${'list_count61_argument'}->ensureDefaultValue('20');
if (!${'list_count61_argument'}->isValid()) {
return ${'list_count61_argument'}->getErrorMessage();
}
${'sort_index57_argument'} = new Argument('sort_index', $args->{'sort_index'});
${'sort_index57_argument'}->ensureDefaultValue('list_order');
if (!${'sort_index57_argument'}->isValid()) {
return ${'sort_index57_argument'}->getErrorMessage();
}
${'sort_order58_argument'} = new SortArgument('sort_order58', $args->sort_order);
${'sort_order58_argument'}->ensureDefaultValue('asc');
if (!${'sort_order58_argument'}->isValid()) {
return ${'sort_order58_argument'}->getErrorMessage();
}
$query->setColumns(array(new StarExpression()));
$query->setTables(array(new Table('`xe_member`', '`member`')));
$query->setConditions(array(new ConditionGroup(array(new ConditionWithArgument('`is_admin`', $is_admin41_argument, "equal"), new ConditionWithArgument('`denied`', $is_denied42_argument, "equal", 'and'), new ConditionWithArgument('`member_srl`', $member_srls43_argument, "in", 'and'))), new ConditionGroup(array(new ConditionWithArgument('`user_id`', $s_user_id44_argument, "like"), new ConditionWithArgument('`user_name`', $s_user_name45_argument, "like", 'or'), new ConditionWithArgument('`nick_name`', $s_nick_name46_argument, "like", 'or'), new ConditionWithArgument('`nick_name`', $html_nick_name47_argument, "like", 'or'), new ConditionWithArgument('`email_address`', $s_email_address48_argument, "like", 'or'), new ConditionWithArgument('`birthday`', $s_birthday49_argument, "like", 'or'), new ConditionWithArgument('`extra_vars`', $s_extra_vars50_argument, "like", 'or'), new ConditionWithArgument('`regdate`', $s_regdate51_argument, "like_prefix", 'or'), new ConditionWithArgument('`last_login`', $s_last_login52_argument, "like_prefix", 'or'), new ConditionWithArgument('`member`.`regdate`', $s_regdate_more53_argument, "more", 'or'), new ConditionWithArgument('`member`.`regdate`', $s_regdate_less54_argument, "less", 'or'), new ConditionWithArgument('`member`.`last_login`', $s_last_login_more55_argument, "more", 'or'), new ConditionWithArgument('`member`.`last_login`', $s_last_login_less56_argument, "less", 'or')), 'and')));
$query->setGroups(array());
$query->setOrder(array(new OrderByColumn(${'sort_index57_argument'}, $sort_order58_argument)));
$query->setLimit(new Limit(${'list_count61_argument'}, ${'page59_argument'}, ${'page_count60_argument'}));
return $query;