當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ca_sets::find方法代碼示例

本文整理匯總了PHP中ca_sets::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP ca_sets::find方法的具體用法?PHP ca_sets::find怎麽用?PHP ca_sets::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ca_sets的用法示例。


在下文中一共展示了ca_sets::find方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _setUniqueSetCode

 /** 
  * 
  */
 private function _setUniqueSetCode()
 {
     if (!$this->getPrimaryKey()) {
         return null;
     }
     $vs_set_code = trim($this->get('set_code'));
     if (($vs_set_code_proc = preg_replace("![ ]+!", "_", $vs_set_code)) !== $vs_set_code || !strlen($vs_set_code)) {
         $this->setMode(ACCESS_WRITE);
         if (!strlen($vs_set_code)) {
             if (!($vs_set_code = $this->getLabelForDisplay())) {
                 $vs_set_code = 'set_' . $this->getPrimaryKey();
             }
         }
         $vs_new_set_name = substr(preg_replace('![^A-Za-z0-9]+!', '_', $vs_set_code), 0, 50);
         if (ca_sets::find(array('set_code' => $vs_new_set_name), array('returnAs' => 'firstId')) > 0) {
             $vs_new_set_name .= '_' . $this->getPrimaryKey();
         }
         $this->set('set_code', $vs_new_set_name);
         return $this->update();
     }
     return false;
 }
開發者ID:kai-iak,項目名稱:providence,代碼行數:25,代碼來源:ca_sets.php

示例2: caGetUserAccessValues

$va_access_values = caGetUserAccessValues($this->request);
if ($vs_set_code = $this->request->config->get("featured_library_set")) {
    AssetLoadManager::register("carousel");
    $t_set = new ca_sets();
    $t_set->load(array('set_code' => $vs_set_code));
    # Enforce access control on set
    if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_set->get("access"), $va_access_values)) {
        $va_item_ids = array_keys(is_array($va_tmp = $t_set->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array());
    }
    if (is_array($va_item_ids) && sizeof($va_item_ids)) {
        $t_object = new ca_objects();
        $va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("slideshowsmall"), array('checkAccess' => caGetUserAccessValues($this->request)));
    }
}
$vs_library_set_code = $this->request->config->get("new_library_set");
$vs_library_code = ca_sets::find(array('set_code' => $vs_library_set_code), array('returnAs' => 'firstId'));
?>
<div class="container">
	<div class="row">
		<div class="col-sm-8 library">
			<h1>Library Advanced Search</h1>
			<p>Enter your search terms in the fields below.</p>
			{{{form}}}
				<div class="advancedSearchField"> 
					{{{_fieldlist%width=200px&height=1&fieldListWidth=100&fieldListHeight=1&fields=_fulltext:Keyword;title:Title;ca_entities.preferred_labels.displayname/author:Author;ca_objects.pub_year:Date of Publication;ca_entities.preferred_labels.displayname/publisher:Publisher;ca_objects.ISBN:ISBN;ca_objects.series:Series;ca_objects.lcsh_terms:Subject;}}}
					{{{_fieldlist:boolean}}}
				</div>

				<div class="advancedSearchField">
					{{{_fieldlist%width=200px&height=1&fieldListWidth=100&fieldListHeight=1&fields=_fulltext:Keyword;title:Title;ca_entities.preferred_labels.displayname/author:Author;ca_objects.pub_year:Date of Publication;ca_entities.preferred_labels.displayname/publisher:Publisher;ca_objects.ISBN:ISBN;ca_objects.series:Series;ca_objects.lcsh_terms:Subject;}}}
					{{{_fieldlist:boolean}}}
開發者ID:kai-iak,項目名稱:pawtucket2,代碼行數:31,代碼來源:ca_objects_advanced_search_library_html.php


注:本文中的ca_sets::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。