本文整理匯總了PHP中JDatabaseQuery::currentTimestamp方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDatabaseQuery::currentTimestamp方法的具體用法?PHP JDatabaseQuery::currentTimestamp怎麽用?PHP JDatabaseQuery::currentTimestamp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JDatabaseQuery
的用法示例。
在下文中一共展示了JDatabaseQuery::currentTimestamp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testFormat
/**
* Tests the JDatabaseQuery::format method.
*
* @return void
*
* @since 12.3
*/
public function testFormat()
{
$result = $this->_instance->format('SELECT %n FROM %n WHERE %n = %a', 'foo', '#__bar', 'id', 10);
$expected = 'SELECT ' . $this->_instance->qn('foo') . ' FROM ' . $this->_instance->qn('#__bar') . ' WHERE ' . $this->_instance->qn('id') . ' = 10';
$this->assertThat($result, $this->equalTo($expected), 'Line: ' . __LINE__ . '.');
$result = $this->_instance->format('SELECT %n FROM %n WHERE %n = %t OR %3$n = %Z', 'id', '#__foo', 'date');
$expected = 'SELECT ' . $this->_instance->qn('id') . ' FROM ' . $this->_instance->qn('#__foo') . ' WHERE ' . $this->_instance->qn('date') . ' = ' . $this->_instance->currentTimestamp() . ' OR ' . $this->_instance->qn('date') . ' = ' . $this->_instance->nullDate(true);
$this->assertThat($result, $this->equalTo($expected), 'Line: ' . __LINE__ . '.');
}