本文整理汇总了PHP中JTable::getDbo方法的典型用法代码示例。如果您正苦于以下问题:PHP JTable::getDbo方法的具体用法?PHP JTable::getDbo怎么用?PHP JTable::getDbo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JTable
的用法示例。
在下文中一共展示了JTable::getDbo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetDbo
/**
* Test for getDbo.
*
* @covers JTable::getDbo
*
* @return void
*
* @since 12.3
*/
public function testGetDbo()
{
$this->assertThat(
$this->object->getDbo(),
$this->isInstanceOf('JDatabaseDriver')
);
}
示例2: addTagMapping
/**
* Method to add tag rows to mapping table.
*
* @param integer $ucmId Id of the #__ucm_content item being tagged
* @param JTable $table JTable object being tagged
* @param array $tags Array of tags to be applied.
*
* @return boolean true on success, otherwise false.
*
* @since 3.1
*/
public function addTagMapping($ucmId, $table, $tags = array())
{
$typeId = $this->typeAlias;
$db = $table->getDbo();
$key = $table->getKeyName();
$item = $table->{$key};
$typeId = $this->getTypeId($this->typeAlias);
// Insert the new tag maps
$query = $db->getQuery(true);
$query->insert('#__contentitem_tag_map');
$query->columns(array($db->quoteName('type_alias'), $db->quoteName('core_content_id'), $db->quoteName('content_item_id'), $db->quoteName('tag_id'), $db->quoteName('tag_date'), $db->quoteName('type_id')));
foreach ($tags as $tag) {
$query->values($db->quote($this->typeAlias) . ', ' . (int) $ucmId . ', ' . (int) $item . ', ' . $db->quote($tag) . ', ' . $query->currentTimestamp() . ', ' . (int) $typeId);
}
$db->setQuery($query);
return (bool) $db->execute();
}
示例3: getFields
/**
* Get Fields.
*
* @param \JTable $table
*
* @return array
*/
public static function getFields(\JTable $table)
{
if (empty(static::$fields[$table->getTableName()])) {
// Lookup the fields for this table only once.
$name = $table->getTableName();
$fields = $table->getDbo()->getTableColumns($name, false);
if (empty($fields)) {
throw new \UnexpectedValueException(sprintf('No columns found for %s table', $name));
}
static::$fields[$table->getTableName()] = $fields;
}
return static::$fields[$table->getTableName()];
}