本文整理汇总了PHP中ca_objects::getTypeName方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::getTypeName方法的具体用法?PHP ca_objects::getTypeName怎么用?PHP ca_objects::getTypeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::getTypeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: media
/**
*
*/
public function media()
{
if (!is_object($t_entity = $this->_checkEntity())) {
return $t_entity;
}
$vn_id = $t_entity->getPrimaryKey();
$t_list = new ca_lists();
$vn_exhibition_audio_type_id = $t_list->getItemIDFromList('object_types', 'MemEx_Audio');
$vs_filter = $this->opo_request->getParameter('filter', pString);
if (!in_array($vs_filter, array('video', 'audio', 'image', 'pdf'))) {
$vs_filter = null;
}
$t_object = new ca_objects();
$va_data = array('id' => $vn_id);
$from = $this->opo_request->getParameter('from', pString);
$until = $this->opo_request->getParameter('until', pString);
if (!$until) {
$until = date('c');
}
$vs_range = $from && $until ? self::utcToDb($from) . ' to ' . self::utcToDb($until) : null;
$o_tep = new TimeExpressionParser();
$vb_parsed_date = false;
if ($vs_range) {
if ($vb_parsed_date = $o_tep->parse($vs_range)) {
$va_range = $o_tep->getUnixTimestamps();
}
}
$t_rep = new ca_object_representations();
$t_list = new ca_lists();
$va_pub_target_values = $t_list->getItemsForList('object_publication_targets', array('extractValuesByUserLocale' => true));
$va_audio_target_values = $t_list->getItemsForList('audio_publication_targets', array('extractValuesByUserLocale' => true));
$vn_memorial_exhibition_audio_type_id = $t_list->getItemIDFromList('object_types', 'MemEx_Audio');
$vn_publish_annotation_id = $t_list->getItemIDFromList('annotation_publication_targets', 'interactive_tables');
$vn_publish_rep = $t_list->getItemIDFromList("memex_status", "publish");
$va_objects = $t_entity->getRelatedItems('ca_objects');
foreach ($va_objects as $vn_relation_id => $va_object_info) {
$va_timestamp = $t_object->getLastChangeTimestamp($va_object_info['object_id']);
if ($vb_parsed_date && ($va_timestamp['timestamp'] <= $va_range['start'] || $va_timestamp['timestamp'] >= $va_range['end'])) {
continue;
}
if ($t_object->load($va_object_info['object_id'])) {
$va_reps = $t_object->getRepresentations(array("preview", "preview170", "icon", "small", "medium", "large", "large_png", "original", "h264_hi", "mp3"));
if (!is_array($va_reps) || !sizeof($va_reps)) {
continue;
}
$va_filtered_reps = array();
foreach ($va_reps as $vn_i => $va_rep) {
$va_tmp = explode('/', $vs_mimetype = $va_rep['info']['original']['MIMETYPE']);
if ($vs_filter && ($va_tmp[0] != $vs_filter && $va_tmp[1] != $vs_filter)) {
continue;
}
$vb_is_audio = false;
if ($t_object->get('type_id') == $vn_memorial_exhibition_audio_type_id) {
$va_pub_targets = $t_object->get('ca_objects.audio_publication_targets', array('returnAsArray' => true, 'convertCodesToDisplayText' => false));
$vb_is_audio = true;
} else {
$va_pub_targets = $t_object->get('ca_objects.object_publication_targets', array('returnAsArray' => true, 'convertCodesToDisplayText' => false));
}
if (!sizeof($va_pub_targets)) {
continue;
}
if (!$t_rep->load($va_rep['representation_id'])) {
continue;
}
if ($t_rep->get("ca_object_representations.memex_status", array('convertCodesToDisplayText' => false)) != $vn_publish_rep) {
continue;
}
// reset filesize property to reflect size of version, not size of original
foreach ($va_reps[$vn_i]['paths'] as $vs_version => $vs_path) {
$va_reps[$vn_i]['info'][$vs_version]['PROPERTIES']['filesize'] = @filesize($va_reps[$vn_i]['paths'][$vs_version]);
}
unset($va_reps[$vn_i]['paths']);
unset($va_reps[$vn_i]['tags']);
unset($va_reps[$vn_i]['media']);
unset($va_reps[$vn_i]['media_metadata']);
unset($va_reps[$vn_i]['is_primary']);
unset($va_reps[$vn_i]['name']);
unset($va_reps[$vn_i]['status']);
unset($va_reps[$vn_i]['locale_id']);
unset($va_reps[$vn_i]['type_id']);
$va_reps[$vn_i]['lastupdate_timestamp'] = date('o-m-N', $va_timestamp['timestamp']) . "T" . date('H:i:s', $va_timestamp['timestamp']) . "Z";
//date('c', $va_timestamp['timestamp']);
$va_reps[$vn_i]['type_id'] = $vn_type_id = $t_object->get('ca_objects.type_id');
$va_reps[$vn_i]['typename'] = $t_object->getTypeName();
$va_reps[$vn_i]['typecode'] = $t_object->getTypeCode();
$va_targets = array();
foreach ($va_pub_targets as $vn_attr_id => $va_value) {
$va_targets[] = $va_pub_target_values[$va_value['object_publication_targets']]['idno'] ? $va_pub_target_values[$va_value['object_publication_targets']]['idno'] : $va_audio_target_values[$va_value['audio_publication_targets']]['idno'];
}
$va_reps[$vn_i]['publication_targets'] = $va_targets;
$va_reps[$vn_i]['title'] = $t_object->get('ca_objects.memex_title');
$va_reps[$vn_i]['credit'] = $t_object->get('ca_objects.memex_credit_line');
$va_reps[$vn_i]['caption'] = $t_object->get('ca_objects.memex_caption');
if ($t_object->get('type_id') == $vn_exhibition_audio_type_id) {
$va_reps[$vn_i]['transcript'] = $t_object->get('ca_objects.final_text_inner_chamber');
$va_reps[$vn_i]['attribution'] = $t_object->get('ca_objects.remembrance_attribution');
}
//.........这里部分代码省略.........