本文整理汇总了PHP中eZDateTime::attribute方法的典型用法代码示例。如果您正苦于以下问题:PHP eZDateTime::attribute方法的具体用法?PHP eZDateTime::attribute怎么用?PHP eZDateTime::attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZDateTime
的用法示例。
在下文中一共展示了eZDateTime::attribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
//.........这里部分代码省略.........
{
$quotePosStart = strpos( $searchText, '"', $pos );
$quotePosEnd = strpos( $searchText, '"', $quotePosStart + 1 );
$prePhraseText = substr( $searchText, $pos, $quotePosStart - $pos );
$postPhraseText = substr( $searchText, $quotePosEnd +1 );
$phraseText = substr( $searchText, $quotePosStart + 1, $quotePosEnd - $quotePosStart - 1 );
$phraseTextArray[] = $phraseText;
// $fullText .= $prePhraseText;
$nonPhraseText .= $prePhraseText;
$pos = $quotePosEnd + 1;
}
}
$nonPhraseText .= $postPhraseText;
*/
$phrasesResult = $this->getPhrases($searchText);
$phraseTextArray = $phrasesResult['phrases'];
$nonPhraseText = $phrasesResult['nonPhraseText'];
$fullText = $phrasesResult['fullText'];
$sectionQuery = '';
if (is_numeric($searchSectionID) and $searchSectionID > 0) {
$sectionQuery = "ezsearch_object_word_link.section_id = '{$searchSectionID}' AND ";
} else {
if (is_array($searchSectionID)) {
// Build query for searching in an array of sections
$sectionQuery = $db->generateSQLINStatement($searchSectionID, 'ezsearch_object_word_link.section_id', false, false, 'int') . " AND ";
}
}
$searchDateQuery = '';
if (is_numeric($searchDate) and $searchDate > 0 or $searchTimestamp) {
$date = new eZDateTime();
$timestamp = $date->timeStamp();
$day = $date->attribute('day');
$month = $date->attribute('month');
$year = $date->attribute('year');
$publishedDateStop = false;
if ($searchTimestamp) {
if (is_array($searchTimestamp)) {
$publishedDate = (int) $searchTimestamp[0];
$publishedDateStop = (int) $searchTimestamp[1];
} else {
$publishedDate = (int) $searchTimestamp;
}
} else {
switch ($searchDate) {
case 1:
$adjustment = 24 * 60 * 60;
//seconds for one day
$publishedDate = $timestamp - $adjustment;
break;
case 2:
$adjustment = 7 * 24 * 60 * 60;
//seconds for one week
$publishedDate = $timestamp - $adjustment;
break;
case 3:
$adjustment = 31 * 24 * 60 * 60;
//seconds for one month
$publishedDate = $timestamp - $adjustment;
break;
case 4:
$adjustment = 3 * 31 * 24 * 60 * 60;
//seconds for three months
$publishedDate = $timestamp - $adjustment;
break;