本文整理汇总了PHP中JTable::_getAssetParentId方法的典型用法代码示例。如果您正苦于以下问题:PHP JTable::_getAssetParentId方法的具体用法?PHP JTable::_getAssetParentId怎么用?PHP JTable::_getAssetParentId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JTable
的用法示例。
在下文中一共展示了JTable::_getAssetParentId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getAssetParentId
protected function _getAssetParentId(JTable $table = null, $id = null)
{
$assetId = null;
if (isset($this->cat_id) && $this->cat_id) {
$cat_id = $this->cat_id;
} elseif ($this->id) {
$cat_id = JUDirectoryHelper::getListingById($this->id)->cat_id;
}
if ($cat_id) {
$query = $this->_db->getQuery(true);
$query->select($this->_db->quoteName('asset_id'));
$query->from($this->_db->quoteName('#__judirectory_categories'));
$query->where($this->_db->quoteName('id') . ' = ' . $cat_id);
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
}
if ($assetId === null) {
$query = $this->_db->getQuery(true);
$query->select($this->_db->quoteName('id'));
$query->from($this->_db->quoteName('#__assets'));
$query->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote('com_judirectory'));
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
}
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例2: _getAssetParentId
/**
* Get the parent asset id for the record
*
* @return int
* @since 1.6
*/
protected function _getAssetParentId($table = null, $id = null)
{
// Initialise variables.
$assetId = null;
$db = $this->getDbo();
// This is a article under a category.
if ($this->catid) {
// Build the query to get the asset id for the parent category.
$query = $db->getQuery(true);
$query->select('asset_id');
$query->from('#__categories');
$query->where('id = ' . (int) $this->catid);
// Get the asset id from the database.
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
}
// Return the asset id.
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例3: _getAssetParentId
protected function _getAssetParentId(JTable $table = null, $id = null)
{
$assetId = null;
if ($this->group_id > 0) {
$query = $this->_db->getQuery(true);
$query->select($this->_db->quoteName('asset_id'));
$query->from($this->_db->quoteName('#__judirectory_fields_groups'));
$query->where($this->_db->quoteName('id') . ' = ' . $this->group_id);
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
}
if (!$assetId) {
$query = $this->_db->getQuery(true);
$query->select($this->_db->quoteName('id'));
$query->from($this->_db->quoteName('#__assets'));
$query->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote('com_judirectory'));
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
}
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例4: _getAssetParentId
/**
* Get the parent asset id for the record
*
* @return int
* @since 1.6
*/
protected function _getAssetParentId(JTable $table = null, $id = null)
{
// search parent document asset ID
$this->_db->setQuery('SELECT `asset_id` FROM `#__joomdoc` WHERE `path` = ' . $this->_db->Quote($this->parent_path) . ' ORDER BY `version` DESC');
if ($parentAssetId = (int) $this->_db->loadResult()) {
return $parentAssetId;
}
// search component asset ID
$this->_db->setQuery('SELECT `id` FROM `#__assets` WHERE `name` = ' . $this->_db->Quote(JOOMDOC_OPTION));
if ($parentAssetId = (int) $this->_db->loadResult()) {
return $parentAssetId;
}
// return default parent asset ID
return parent::_getAssetParentId($table, $id);
}
示例5: getAssetParentId
/**
* Method to get the parent asset id for the record
*
* @param JTable $table A JTable object for the asset parent
* @param integer $id
*
* @return integer
*/
protected function getAssetParentId(JTable $table = null, $id = null)
{
// Initialise variables.
$assetId = null;
$db = $this->getDbo();
$query = $db->getQuery(true)->select('id')->from('#__assets')->where('name = ' . $db->quote('com_modules'));
// Get the asset id from the database.
$db->setQuery($query);
if ($result = $db->loadResult()) {
$assetId = (int) $result;
}
// Return the asset id.
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例6: _getAssetParentId
protected function _getAssetParentId($table = null, $id = null)
{
$assetId = null;
$db = $this->getDbo();
$query = $db->getQuery(true);
$query->select('id');
$query->from('#__assets');
$query->where('name = ' . $db->quote('com_igallery'));
$db->setQuery($query);
if ($result = $db->loadResult()) {
$assetId = (int) $result;
}
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例7: _getAssetParentId
protected function _getAssetParentId(JTable $table = null, $id = null)
{
$assetId = null;
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id');
$query->from('#__assets');
$query->where('name = "com_judirectory"');
$db->setQuery($query);
if ($result = $db->loadResult()) {
$assetId = (int) $result;
}
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例8: _getAssetParentId
/**
* Method to get the parent asset id for the record
*
* @param JTable $table A JTable object (optional) for the asset parent
* @param integer $id The id (optional) of the content.
*
* @return integer
*
* @since 11.1
*/
protected function _getAssetParentId(JTable $table = null, $id = null)
{
$assetId = null;
// This is a module that needs to parent with the extension.
if ($assetId === null) {
// Build the query to get the asset id of the parent component.
$query = $this->_db->getQuery(true)->select($this->_db->quoteName('id'))->from($this->_db->quoteName('#__assets'))->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote('com_modules'));
// Get the asset id from the database.
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
}
// Return the asset id.
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例9: _getAssetParentId
/**
* Method to get the parent asset id for the record
*
* @param JTable $table A JTable object (optional) for the asset parent
* @param integer $id The id (optional) of the content.
*
* @return integer
*
* @since 11.1
*/
protected function _getAssetParentId(JTable $table = null, $id = null)
{
$assetId = null;
// This is a point under a category.
if ($this->townid) {
// Build the query to get the asset id for the parent category.
$query = $this->_db->getQuery(true)->select($this->_db->quoteName('asset_id'))->from($this->_db->quoteName('#__places_point'))->where($this->_db->quoteName('id') . ' = ' . (int) $this->townid);
// Get the asset id from the database.
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
}
// Return the asset id.
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例10: _getAssetParentId
/**
* Get the parent asset id for the record
*
* @return int
*/
protected function _getAssetParentId()
{
// Initialise variables.
$assetId = null;
$db = $this->getDbo();
// Build the query to get the asset id for the parent category.
$query = $db->getQuery(true);
$query->select('id');
$query->from('#__assets');
$query->where('name = ' . $db->quote('com_jinc'));
// Get the asset id from the database.
$db->setQuery($query);
if ($result = $db->loadResult()) {
$assetId = (int) $result;
}
// Return the asset id.
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId();
}
}
示例11: _getAssetParentId
/**
* Method to get the parent asset id for the record
*
* @param JTable $table A JTable object (optional) for the asset parent
* @param integer $id The id (optional) of the content.
*
* @return integer
*
* @since 11.1
*/
protected function _getAssetParentId(JTable $table = null, $id = null)
{
// Initialise variables.
$assetId = null;
// Build the query to get the asset id for the component.
$query = $this->_db->getQuery(true);
$query->select($this->_db->quoteName('id'));
$query->from($this->_db->quoteName('#__assets'));
$query->where($this->_db->quoteName('name') . " LIKE 'com_bwpostman'");
// Get the asset id from the database.
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
// Return the asset id.
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例12: _getAssetParentId
/**
* Get the parent asset id for the record
*
* @return int
* @since 1.6
*/
protected function _getAssetParentId($table = null, $id = null)
{
// Initialise variables.
$assetId = null;
$db = $this->getDbo();
$extension = 'com_solidres';
// This is a category under a category.
if ($this->parent_id > 1) {
// Build the query to get the asset id for the parent category.
$query = $db->getQuery(true);
$query->select('asset_id')->from('#__sr_categories')->where('id = ' . (int) $this->parent_id);
// Get the asset id from the database.
$db->setQuery($query);
if ($result = $db->loadResult()) {
$assetId = (int) $result;
}
} elseif ($assetId === null) {
// Build the query to get the asset id for the parent category.
$query = $db->getQuery(true);
$query->select('id')->from('#__assets')->where('name = ' . $db->quote($extension));
// Get the asset id from the database.
$db->setQuery($query);
if ($result = $db->loadResult()) {
$assetId = (int) $result;
}
}
// Return the asset id.
if ($assetId) {
return $assetId;
} else {
return parent::_getAssetParentId($table, $id);
}
}
示例13: _getAssetParentId
/**
* Method to get the parent asset under which to register this one.
* By default, all assets are registered to the ROOT node with ID,
* which will default to 1 if none exists.
* The extended class can define a table and id to lookup. If the
* asset does not exist it will be created.
*
* @param JTable $table A JTable object for the asset parent.
* @param integer $id Id to look up
*
* @return integer
*
* @since 3.6
*/
protected function _getAssetParentId(JTable $table = null, $id = null)
{
$assetId = null;
$asset = JTable::getInstance('asset');
if ($asset->loadByName('com_menus')) {
$assetId = $asset->id;
}
return is_null($assetId) ? parent::_getAssetParentId($table, $id) : $assetId;
}
示例14: _getAssetParentId
/**
* Method to get the asset-parent-id of the item
*
* @return int
*/
protected function _getAssetParentId(JTable $table = null, $id = null)
{
// We will retrieve the parent-asset from the visforms table
$assetId = null;
$fid = $this->fid;
if ($fid > 0) {
// Build the query to get the asset id for the parent category.
$query = $this->_db->getQuery(true);
$query->select($this->_db->quoteName('asset_id'));
$query->from($this->_db->quoteName('#__visforms'));
$query->where($this->_db->quoteName('id') . ' = ' . (int) $fid);
// Get the asset id from the database.
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
} else {
//use component as default
$assetParent = JTable::getInstance('Asset');
// Default: if no asset-parent can be found we take the global asset
$assetId = $assetParent->getRootId();
// The item has the component as asset-parent
$assetParent->loadByName('com_visforms');
// Return the found asset-parent-id
if ($assetParent->id) {
$assetId = $assetParent->id;
}
}
// Return the asset id.
if ($assetId) {
return $assetId;
}
return parent::_getAssetParentId($table, $id);
}
示例15: _getAssetParentId
/**
* Get the parent asset id for the record
*
* @return int
* @since 1.6
*/
protected function _getAssetParentId(JTable $table = null, $id = null)
{
// Initialise variables.
$assetId = null;
// This is a project under a department.
if ($this->parent_id_key) {
// Build the query to get the asset id for the parent category.
$query = $this->_db->getQuery(true);
$query->select($this->_db->quoteName('asset_id'));
$query->from($this->_db->quoteName('#__parent_item_table'));
$query->where($this->_db->quoteName('id') . ' = ' . (int) $this->parent_id_key);
// Get the asset id from the database.
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult()) {
$assetId = (int) $result;
}
}
// Return the asset id.
if ($assetId) {
return $assetId;
}
return parent::_getAssetParentId($table, $id);
}