本文整理汇总了PHP中JTable::publish方法的典型用法代码示例。如果您正苦于以下问题:PHP JTable::publish方法的具体用法?PHP JTable::publish怎么用?PHP JTable::publish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JTable
的用法示例。
在下文中一共展示了JTable::publish方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPublish
/**
* Test the publish method.
*
* @return void
*
* @since 12.3
*/
public function testPublish()
{
$this->object->publish(array(array('id1' => 25, 'id2' => 50), array('id1' => 25, 'id2' => 51)), 2);
$this->object->load(array('id1' => 25, 'id2' => 50));
$this->assertEquals(2, $this->object->published);
$this->object->load(array('id1' => 25, 'id2' => 51));
$this->assertEquals(2, $this->object->published);
}
示例2: publish
function publish($cids, $value)
{
$db = JFactory::getDBO();
$ids = array();
foreach ($cids as $id) {
$ids[] = (int) FSSJ3Helper::getEscaped($db, $id);
}
$query = "SELECT * FROM #__fss_ticket_status WHERE id IN ( " . implode(", ", $ids) . ")";
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ($rows as $row) {
if ($row->def_user || $row->def_open || $row->def_admin) {
return "You cannot unpublish your default status";
}
}
return parent::publish($cids, $value);
}