当前位置: 首页>>代码示例>>PHP>>正文


PHP JTable::_getAssetParentId方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:34,代码来源:listing.php

示例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);
     }
 }
开发者ID:Joomla-on-NoSQL,项目名称:LaMojo,代码行数:31,代码来源:content.php

示例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);
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:29,代码来源:field.php

示例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);
 }
开发者ID:abdullah929,项目名称:bulletin,代码行数:21,代码来源:document.php

示例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);
     }
 }
开发者ID:esorone,项目名称:efcpw,代码行数:26,代码来源:advancedmodules.php

示例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);
     }
 }
开发者ID:iFactoryDigital,项目名称:gympieradiology,代码行数:18,代码来源:igallery_profiles_j25.php

示例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);
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:18,代码来源:moderator.php

示例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);
     }
 }
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:30,代码来源:module.php

示例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);
     }
 }
开发者ID:buyanov,项目名称:com_places,代码行数:30,代码来源:points.php

示例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();
     }
 }
开发者ID:madseller,项目名称:coperio,代码行数:27,代码来源:newsletter.php

示例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);
     }
 }
开发者ID:RomanaBW,项目名称:BwPostman,代码行数:31,代码来源:newsletters.php

示例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);
     }
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:39,代码来源:category.php

示例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;
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:23,代码来源:type.php

示例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);
 }
开发者ID:shamusdougan,项目名称:GDMCWebsite,代码行数:39,代码来源:visfield.php

示例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);
 }
开发者ID:TFToto,项目名称:playjoom-builds,代码行数:29,代码来源:audiotrack.php


注:本文中的JTable::_getAssetParentId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。