本文整理汇总了PHP中Book::buildBookListCriteria方法的典型用法代码示例。如果您正苦于以下问题:PHP Book::buildBookListCriteria方法的具体用法?PHP Book::buildBookListCriteria怎么用?PHP Book::buildBookListCriteria使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Book
的用法示例。
在下文中一共展示了Book::buildBookListCriteria方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildSiteListCriteria
public static function buildSiteListCriteria(&$criteria, &$params_list, $is_module = false, $mid = 'm.id')
{
if (empty($params_list)) {
return null;
}
$conditions = $values = $joins = array();
if ($is_module) {
$m = 'm';
$m2 = 's';
$midi18n = $mid;
$join = null;
$join_id = null;
$join_idi18n = null;
$join_i18n = 'site_i18n';
} else {
$m = 't';
$m2 = 's';
$mid = array('l' . $m, $mid);
$midi18n = implode('.', $mid);
$join = 'site';
$join_id = $join . '_id';
$join_idi18n = $join . '_idi18n';
$join_i18n = $join . '_i18n';
}
$nb_id = 0;
$nb_name = 0;
if ($is_module) {
$nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $mid, 'id', $join_id);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Id', 'lt.main_id', 'sites', 'site_id');
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Id', 'ltt.linked_id', 'subsites', 'subsite_id');
} else {
$nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', $mid, 'sites', $join_id);
}
$has_id = $nb_id == 1;
if (!$has_id) {
if ($is_module) {
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Georef', $join, 'geom', $join);
}
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Around', $m2 . '.geom', 'tarnd', $join);
$nb_name = self::buildConditionItem($conditions, $values, $joins, $params_list, 'String', array($midi18n, 'ti.search_name'), $is_module ? array('tnam', 'name') : 'tnam', array($join_idi18n, $join_i18n), 'Site');
if ($nb_name === 'no_result') {
return $nb_name;
}
$nb_id += $nb_name;
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.elevation', 'talt', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Array', array($m, $m2, 'site_types'), 'ttyp', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Array', array($m, $m2, 'climbing_styles'), 'tcsty', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.equipment_rating', 'tprat', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.routes_quantity', 'rqua', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.mean_height', 'tmhei', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.mean_rating', 'tmrat', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Array', array($m, $m2, 'facings'), 'tfac', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Array', array($m, $m2, 'rock_types'), 'trock', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.children_proof', 'chil', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.rain_proof', 'rain', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'ti.culture', 'tcult', $join_i18n);
// book criteria
$nb_name = Book::buildBookListCriteria($criteria, $params_list, false, 't', 'main_id');
if ($nb_name === 'no_result') {
return $nb_name;
}
// article criteria
$nb_name = Article::buildArticleListCriteria($criteria, $params_list, false, 't', 'linked_id');
if ($nb_name === 'no_result') {
return $nb_name;
}
if (isset($criteria[2]['join_tbook']) || isset($criteria[2]['join_tarticle'])) {
$joins['join_site'] = true;
if (!$is_module) {
$joins['post_site'] = true;
}
}
}
if (!empty($conditions)) {
$criteria[0] = array_merge($criteria[0], $conditions);
$criteria[1] = array_merge($criteria[1], $values);
}
if (!empty($joins)) {
$joins['join_site'] = true;
}
if ($is_module && $nb_id) {
$joins['nb_id'] = $nb_id;
}
$criteria[2] += $joins;
return null;
}
示例2: buildListCriteria
public static function buildListCriteria($params_list)
{
$criteria = $conditions = $values = $joins = $joins_order = array();
$criteria[0] = array();
// conditions
$criteria[1] = array();
// values
$criteria[2] = array();
// joins
$criteria[3] = array();
// joins for order
// criteria for disabling personal filter
self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'books');
// orderby criteria
$orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
self::buildOrderCondition($joins_order, $orderby_list, array('bnam'), array('book_i18n', 'join_book'));
// return if no criteria
if (isset($joins['all']) || empty($params_list)) {
$criteria[0] = $conditions;
$criteria[1] = $values;
$criteria[2] = $joins;
$criteria[3] = $joins_order;
return $criteria;
}
// area criteria
self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', array('g', 'linked_id'), 'areas', 'area_id');
// book / article criteria
$has_name = Book::buildBookListCriteria($criteria, $params_list, true);
if ($has_name === 'no_result') {
return $has_name;
}
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Istring', 'm.author', 'auth', null);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Istring', 'm.editor', 'edit', null);
// linked doc criteria
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'lbd.linked_id', 'bdocs', 'bdoc');
// image criteria
$has_name = Image::buildImageListCriteria($criteria, $params_list, false);
if ($has_name === 'no_result') {
return $has_name;
}
$criteria[0] = array_merge($criteria[0], $conditions);
$criteria[1] = array_merge($criteria[1], $values);
$criteria[2] += $joins;
$criteria[3] += $joins_order;
return $criteria;
}
示例3: buildParkingListCriteria
public static function buildParkingListCriteria(&$criteria, &$params_list, $is_module = false, $mid = 'm.id', $m = 'p')
{
if (empty($params_list)) {
return null;
}
$conditions = $values = $joins = array();
if ($is_module) {
$m = 'm';
$m2 = 'p';
$midi18n = $mid;
$join = null;
$join_id = null;
$join_idi18n = null;
$join_i18n = 'parking_i18n';
} else {
$m2 = $m;
$mid = array('l' . $m, $mid);
$midi18n = implode('.', $mid);
$join = 'parking';
$join_id = $join . '_id';
$join_idi18n = $join . '_idi18n';
$join_i18n = $join . '_i18n';
}
$nb_id = 0;
$nb_name = 0;
if ($is_module) {
$nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $mid, 'id', $join_id);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Id', 'lp.main_id', 'parkings', 'parking_id');
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Id', 'lpp.linked_id', 'subparkings', 'subparking_id');
} else {
$nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', $mid, 'parkings', $join_id);
}
$has_id = $nb_id == 1;
if (!$has_id) {
if ($is_module) {
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Georef', $join, 'geom', $join);
}
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Around', $m2 . '.geom', 'parnd', $join);
$nb_name = self::buildConditionItem($conditions, $values, $joins, $params_list, 'String', array($midi18n, 'pi.search_name'), $is_module ? array('pnam', 'name') : 'pnam', array($join_idi18n, $join_i18n), 'Parking');
if ($nb_name === 'no_result') {
return $nb_name;
}
$nb_id += $nb_name;
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.elevation', 'palt', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.public_transportation_rating', 'tp', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Array', array($m, $m2, 'public_transportation_types'), 'tpty', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'pi.culture', 'pcult', $join_i18n);
// book criteria
$nb_name = Book::buildBookListCriteria($criteria, $params_list, false, 'p', 'main_id');
if ($nb_name === 'no_result') {
return $nb_name;
}
// article criteria
$nb_name = Article::buildArticleListCriteria($criteria, $params_list, false, 'p', 'linked_id');
if ($nb_name === 'no_result') {
return $nb_name;
}
if (isset($criteria[2]['join_pbook']) || isset($criteria[2]['join_particle'])) {
$joins['join_parking'] = true;
if (!$is_module) {
$joins['post_parking'] = true;
}
}
}
if (!empty($conditions)) {
$criteria[0] = array_merge($criteria[0], $conditions);
$criteria[1] = array_merge($criteria[1], $values);
}
if (!empty($joins)) {
$joins['join_parking'] = true;
}
if ($is_module && $nb_id) {
$joins['nb_id'] = $nb_id;
}
$criteria[2] += $joins;
return null;
}
示例4: buildListCriteria
public static function buildListCriteria($params_list)
{
$criteria = $conditions = $values = $joins = $joins_order = array();
$criteria[0] = array();
// conditions
$criteria[1] = array();
// values
$criteria[2] = array();
// joins
$criteria[3] = array();
// joins for order
// criteria for disabling personal filter
self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'articles');
// orderby criteria
$orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
self::buildOrderCondition($joins_order, $orderby_list, array('cnam'), array('article_i18n', 'join_article'));
// area criteria
self::buildAreaCriteria($criteria, $params_list, 'a');
// return if no criteria
if (isset($joins['all']) || empty($params_list)) {
$criteria[0] = array_merge($criteria[0], $conditions);
$criteria[1] = array_merge($criteria[1], $values);
$criteria[2] += $joins;
$criteria[3] += $joins_order;
return $criteria;
}
// article criteria
$has_name = Article::buildArticleListCriteria($criteria, $params_list, true);
if ($has_name === 'no_result') {
return $has_name;
}
// linked document criteria
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'lcd.main_id', 'cdocs', 'cdoc');
// summit criteria
$has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
if ($has_name === 'no_result') {
return $has_name;
}
// hut criteria
$has_name = Hut::buildHutListCriteria($criteria, $params_list, false, 'main_id');
if ($has_name === 'no_result') {
return $has_name;
}
// parking criteria
$has_name = Parking::buildParkingListCriteria($criteria, $params_list, false, 'main_id');
if ($has_name === 'no_result') {
return $has_name;
}
// route criteria
$has_name = Route::buildRouteListCriteria($criteria, $params_list, false, 'main_id');
if ($has_name === 'no_result') {
return $has_name;
}
// site criteria
$has_name = Site::buildSiteListCriteria($criteria, $params_list, false, 'main_id');
if ($has_name === 'no_result') {
return $has_name;
}
// outing criteria
$has_name = Outing::buildOutingListCriteria($criteria, $params_list, false, 'main_id');
if ($has_name === 'no_result') {
return $has_name;
}
// book criteria
$has_name = Book::buildBookListCriteria($criteria, $params_list, false, 'c', 'main_id');
if ($has_name === 'no_result') {
return $has_name;
}
// image criteria
$has_name = Image::buildImageListCriteria($criteria, $params_list, false);
if ($has_name === 'no_result') {
return $has_name;
}
// user criteria
self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', array('u', 'main_id'), 'users', 'user_id');
$criteria[0] = array_merge($criteria[0], $conditions);
$criteria[1] = array_merge($criteria[1], $values);
$criteria[2] += $joins;
$criteria[3] += $joins_order;
return $criteria;
}
示例5: buildHutListCriteria
public static function buildHutListCriteria(&$criteria, &$params_list, $is_module = false, $mid = 'm.id')
{
if (empty($params_list)) {
return null;
}
$conditions = $values = $joins = array();
if ($is_module) {
$m = 'm';
$m2 = 'h';
$midi18n = $mid;
$join = null;
$join_id = null;
$join_idi18n = null;
$join_i18n = 'hut_i18n';
} else {
$m = 'h';
$m2 = $m;
$mid = array('l' . $m, $mid);
$midi18n = implode('.', $mid);
$join = 'hut';
$join_id = $join . '_id';
$join_idi18n = $join . '_idi18n';
$join_i18n = $join . '_i18n';
}
$nb_id = 0;
$nb_name = 0;
if ($is_module) {
$nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $mid, array('id', 'huts'), $join_id);
} else {
$nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', $mid, 'huts', $join_id);
}
$has_id = $nb_id == 1;
if (!$has_id) {
if ($is_module) {
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Array', array($m, 'h', 'activities'), 'act', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Georef', $join, 'geom', $join);
}
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Around', $m2 . '.geom', 'harnd', $join);
$nb_name = self::buildConditionItem($conditions, $values, $joins, $params_list, 'String', array($midi18n, 'hi.search_name'), $is_module ? array('hnam', 'name') : 'hnam', array($join_idi18n, $join_i18n), 'Hut');
if ($nb_name === 'no_result') {
return $nb_name;
}
$nb_id += $nb_name;
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Array', array($m, 'h', 'activities'), 'hact', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.elevation', 'halt', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.shelter_type', 'htyp', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Bool', $m . '.is_staffed', 'hsta', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.staffed_capacity', 'hscap', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.unstaffed_capacity', 'hucap', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.has_unstaffed_matress', 'hmat', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.has_unstaffed_blanket', 'hbla', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.has_unstaffed_gas', 'hgas', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.has_unstaffed_wood', 'hwoo', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'hi.culture', 'hcult', $join_i18n);
// book criteria
$nb_name = Book::buildBookListCriteria($criteria, $params_list, false, 'h', 'main_id');
if ($nb_name === 'no_result') {
return $nb_name;
}
// article criteria
$nb_name = Article::buildArticleListCriteria($criteria, $params_list, false, 'h', 'linked_id');
if ($nb_name === 'no_result') {
return $nb_name;
}
if (isset($criteria[2]['join_hbook']) || isset($criteria[2]['join_harticle'])) {
$joins['join_hut'] = true;
if (!$is_module) {
$joins['post_hut'] = true;
}
}
}
if (!empty($conditions)) {
$criteria[0] = array_merge($criteria[0], $conditions);
$criteria[1] = array_merge($criteria[1], $values);
}
if (!empty($joins)) {
$joins['join_hut'] = true;
}
if ($is_module && $nb_id) {
$joins['nb_id'] = $nb_id;
}
$criteria[2] += $joins;
return null;
}
示例6: buildSummitListCriteria
public static function buildSummitListCriteria(&$criteria, &$params_list, $is_module = false, $mid = 'm.id')
{
if (empty($params_list)) {
return null;
}
$conditions = $values = $joins = array();
if ($is_module) {
$m = 'm';
$m2 = 's';
$midi18n = $mid;
$join = null;
$join_id = null;
$join_idi18n = null;
$join_i18n = 'summit_i18n';
} else {
$m = 's';
$m2 = $m;
$mid = array('l' . $m, $mid);
$midi18n = implode('.', $mid);
$join = 'summit';
$join_id = $join . '_id';
$join_idi18n = $join . '_idi18n';
$join_i18n = $join . '_i18n';
}
$nb_id = 0;
$nb_name = 0;
if ($is_module) {
$nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $mid, 'id', $join_id);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Id', 'ls.main_id', 'summits', 'summit_id');
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Id', 'lss.linked_id', 'subsummits', 'subsummit_id');
} else {
$nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', $mid, 'summits', $join_id);
}
$has_id = $nb_id == 1;
if (!$has_id) {
if ($is_module) {
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Georef', $join, 'geom', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Istring', 'maps_info', 'mapinfo', $join);
}
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Around', $m2 . '.geom', 'sarnd', $join);
$nb_name = self::buildConditionItem($conditions, $values, $joins, $params_list, 'String', array($midi18n, 'si.search_name'), $is_module ? array('snam', 'name') : 'snam', array($join_idi18n, $join_i18n), 'Summit');
if ($nb_name === 'no_result') {
return $nb_name;
}
$nb_id += $nb_name;
self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.elevation', 'salt', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.summit_type', 'styp', $join);
self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'si.culture', 'scult', $join_i18n);
// book criteria
$nb_name = Book::buildBookListCriteria($criteria, $params_list, false, 's', 'main_id');
if ($nb_name === 'no_result') {
return $nb_name;
}
// article criteria
$nb_name = Article::buildArticleListCriteria($criteria, $params_list, false, 's', 'linked_id');
if ($nb_name === 'no_result') {
return $nb_name;
}
if (isset($criteria[2]['join_sbook']) || isset($criteria[2]['join_sarticle'])) {
$joins['join_summit'] = true;
if (!$is_module) {
$joins['post_summit'] = true;
}
}
}
if (!empty($conditions)) {
$criteria[0] = array_merge($criteria[0], $conditions);
$criteria[1] = array_merge($criteria[1], $values);
}
if (!empty($joins)) {
$joins['join_summit'] = true;
}
if ($is_module && $nb_id) {
$joins['nb_id'] = $nb_id;
}
$criteria[2] += $joins;
return null;
}