本文整理汇总了PHP中ca_objects::getLastChangeTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::getLastChangeTimestamp方法的具体用法?PHP ca_objects::getLastChangeTimestamp怎么用?PHP ca_objects::getLastChangeTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::getLastChangeTimestamp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recentlyAdded
function recentlyAdded()
{
// redirect user if not logged in
if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
} elseif ($this->request->config->get('show_bristol_only') && $this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "bristol", "Show", "Index"));
}
$t_object = new ca_objects();
if (($vn_num_items = (int) $this->request->config->get('rss_number_of_items')) <= 0) {
$vn_num_items = 10;
}
$va_recently_added_objects = $t_object->getRecentlyAddedItems($vn_num_items, array('checkAccess' => caGetUserAccessValues($this->request)));
$va_entries = array();
$va_object_ids = array();
foreach ($va_recently_added_objects as $va_object) {
$va_object_ids[] = $va_object['object_id'];
}
$qr_res = $t_object->makeSearchResult('ca_objects', $va_object_ids);
$vs_description_bundle = $this->request->config->get('rss_description');
while ($qr_res->nextHit()) {
$vn_object_id = $qr_res->get('ca_objects.object_id');
if (!($vn_creation_time = $t_object->getCreationTimestamp($vn_object_id, array('timestampOnly' => true)))) {
$vn_creation_time = time();
}
if (!($vn_update_time = $t_object->getLastChangeTimestamp($vn_object_id, array('timestampOnly' => true)))) {
$vn_update_time = time();
}
$va_entries[] = array('title' => $qr_res->get('ca_objects.preferred_labels.name'), 'link' => $vs_link = $this->request->config->get('site_host') . caNavUrl($this->request, '', 'Detail/Object', 'Index', array('object_id' => $vn_object_id)), 'guid' => $vs_link, 'lastUpdate' => $vn_update_time, 'description' => $vs_description_bundle ? $qr_res->getMediaTag("ca_object_representations.media", "preview") . "\n" . $qr_res->get($vs_description_bundle) : '', 'pubDate' => $vn_creation_time);
}
$va_feed_data = array('title' => _t('Recently added'), 'link' => $this->request->getRequestUrl(true), 'charset' => 'UTF-8', 'entries' => $va_entries);
$o_feed = Zend_Feed::importArray($va_feed_data, 'rss');
$this->view->setVar('feed', $o_feed);
$this->render('Feed/feed_recently_added_xml.php');
}
示例2: 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');
}
//.........这里部分代码省略.........