本文整理汇总了PHP中CF7DBPlugin::formatDate方法的典型用法代码示例。如果您正苦于以下问题:PHP CF7DBPlugin::formatDate方法的具体用法?PHP CF7DBPlugin::formatDate怎么用?PHP CF7DBPlugin::formatDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CF7DBPlugin
的用法示例。
在下文中一共展示了CF7DBPlugin::formatDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nextRow
/**
* Fetch next row into variable
* @return bool if next row exists
*/
public function nextRow()
{
if (!$this->results) {
return false;
}
while (true) {
if (!$this->onFirstRow) {
$this->row = mysql_fetch_assoc($this->results);
}
$this->onFirstRow = false;
if (!$this->row) {
mysql_free_result($this->results);
$this->results = null;
return false;
}
// Format the date
$submitTime = $this->row['Submitted'];
$this->row['submit_time'] = $submitTime;
$this->row['Submitted'] = $this->plugin->formatDate($submitTime);
// Determine if row is filtered
if ($this->rowFilter) {
$match = $this->rowFilter->evaluate($this->row);
if (!$match) {
continue;
}
}
$this->idx += 1;
if ($this->limitStart && $this->idx < $this->limitStart) {
continue;
}
if ($this->limitEnd && $this->idx >= $this->limitEnd) {
while (mysql_fetch_array($this->results)) {
}
mysql_free_result($this->results);
$this->results = null;
$this->row = null;
return false;
}
// Keep the unformatted submitTime if needed
if ($this->submitTimeKeyName) {
$this->row[$this->submitTimeKeyName] = $submitTime;
}
break;
}
if (!$this->row) {
mysql_free_result($this->results);
$this->results = null;
}
return $this->row ? true : false;
}
示例2: nextRow
/**
* Fetch next row into variable
* @return bool if next row exists
*/
public function nextRow()
{
while (true) {
if (!$this->onFirstRow) {
$this->row = $this->fetchRow();
}
$this->onFirstRow = false;
if (!$this->row) {
$this->freeResult();
return false;
}
// Format the date
if (!isset($this->row['submit_time']) && isset($this->row['Submitted']) && is_numeric($this->row['Submitted'])) {
$submitTime = $this->row['Submitted'];
$this->row['submit_time'] = $submitTime;
$this->row['Submitted'] = $this->plugin->formatDate($submitTime);
}
// Determine if row is filtered
if ($this->rowFilter) {
$match = $this->rowFilter->evaluate($this->row);
if (!$match) {
continue;
}
}
$this->idx += 1;
if ($this->limitStart && $this->idx < $this->limitStart) {
continue;
}
if ($this->limitEnd && $this->idx >= $this->limitEnd) {
while ($this->row = $this->fetchRow()) {
}
$this->freeResult();
$this->row = null;
return false;
}
// Keep the unformatted submitTime if needed
if (isset($submitTime) && $this->submitTimeKeyName) {
$this->row[$this->submitTimeKeyName] = $submitTime;
}
break;
}
if (!$this->row) {
$this->freeResult();
}
return $this->row ? true : false;
}