本文整理汇总了PHP中JTable::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP JTable::reset方法的具体用法?PHP JTable::reset怎么用?PHP JTable::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JTable
的用法示例。
在下文中一共展示了JTable::reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testReset
/**
* Test for reset method.
*
* @covers JTable::reset
*
* @return void
*
* @since 12.3
*/
public function testReset()
{
$this->object->title = 'My Title';
$this->object->id1 = 25;
$this->object->id2 = 50;
$this->object->reset();
// The regular fields should get reset
$this->assertEquals(
'\'\'',
$this->object->title
);
// The primary keys should be left alone.
$this->assertEquals(
25,
$this->object->id1
);
$this->assertEquals(
50,
$this->object->id2
);
}
示例2: reset
/**
* Method to reset class properties to the defaults set in the class
* definition. It will ignore the primary key as well as any private class
* properties.
*/
public function reset()
{
parent::reset();
if (!$this->onAfterReset()) {
return false;
}
}
示例3: reset
/**
* Method to reset class properties to the defaults set in the class
* definition. It will ignore the primary key as well as any private class
* properties (except $_errors).
*
* @return void
*
* @since 3.2.1
*/
public function reset()
{
parent::reset();
// Reset the location properties.
$this->setLocation(0);
}