本文整理汇总了PHP中ca_objects::getCreationTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::getCreationTimestamp方法的具体用法?PHP ca_objects::getCreationTimestamp怎么用?PHP ca_objects::getCreationTimestamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::getCreationTimestamp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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');
}