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


PHP ca_metadata_elements::getAttributeTypes方法代碼示例

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


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

示例1: getAttributesByElement

 /**
  *
  * @param string $type can be one of: ["ca_objects", "ca_entities", "ca_places", "ca_occurrences", "ca_collections", "ca_list_items", "ca_object_representations", "ca_storage_locations", "ca_movements", "ca_loans", "ca_tours", "ca_tour_stops"]
  * @param int $item_id primary key
  * @param string $attribute_code_or_id
  * @return array
  * @throws SoapFault
  */
 public function getAttributesByElement($type, $item_id, $attribute_code_or_id)
 {
     if (!($t_subject_instance = $this->getTableInstance($type, $item_id, true))) {
         throw new SoapFault("Server", "Invalid type or item_id");
     }
     $t_locale = new ca_locales();
     $t_element = new ca_metadata_elements();
     $va_attrs = $t_subject_instance->getAttributesByElement($attribute_code_or_id);
     $va_return = array();
     $va_element_type_cfg = ca_metadata_elements::getAttributeTypes();
     foreach ($va_attrs as $vo_attr) {
         $va_attr = array();
         foreach ($vo_attr->getValues() as $vo_value) {
             $t_element->load($vo_value->getElementID());
             $va_attr[] = array("value_id" => $vo_value->getValueID(), "display_value" => $vo_value->getDisplayValue(), "element_code" => $vo_value->getElementCode(), "element_id" => $vo_value->getElementID(), "attribute_info" => $t_subject_instance->getAttributeLabelAndDescription($vo_value->getElementCode()), "datatype" => $va_element_type_cfg[$t_element->get("datatype")], "locale" => $t_locale->localeIDToCode($vo_attr->getLocaleID()));
         }
         $va_return[$vo_attr->getAttributeID()] = $va_attr;
     }
     return $va_return;
 }
開發者ID:kai-iak,項目名稱:pawtucket2,代碼行數:28,代碼來源:ItemInfoService.php

示例2: getAttributeNameForTypeCode

 /**
  * Returns data type name for numeric code
  *
  * @param $pn_type_code numeric type code
  * @return string Name of data type (eg. 'Text') or null if code is not defined
  */
 public static function getAttributeNameForTypeCode($pn_type_code)
 {
     $va_types = ca_metadata_elements::getAttributeTypes();
     return isset($va_types[$pn_type_code]) ? $va_types[$pn_type_code] : null;
 }
開發者ID:guaykuru,項目名稱:pawtucket,代碼行數:11,代碼來源:ca_metadata_elements.php


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