english/libraries/joomla/database/table/content.php
/**
	 * 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
	 *
	 * @since   11.1
	 */
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


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($table = null, $id = null)
	{
		$assetId = null;
		$db = $this->getDbo();
		if ($this->catid) {
			$query	= $db->getQuery(true);
			$query->select('asset_id');
			$query->from('#__categories');
			$query->where('id = '.(int) $this->catid);
			$this->_db->setQuery($query);
			if ($result = $this->_db->loadResult()) {
				$assetId = (int) $result;
			}
		}
		if ($assetId) {
			return $assetId;
		} else {
			return parent::_getAssetParentId($table, $id);
		}
	}
protected function _getAssetParentId ( $ table = null , $ id = null ) { $ assetId = null ; $ db = $ this -> getDbo ( ) ; if ( $ this -> catid ) { $ query = $ db -> getQuery ( true ) ; $ query -> select ( 'asset_id' ) ; $ query -> from ( '#__categories' ) ; $ query -> where ( 'id = ' . ( int ) $ this -> catid ) ; $ this -> _db -> setQuery ( $ query ) ; if ( $ result = $ this -> _db -> loadResult ( ) ) { $ assetId = ( int ) $ result ; } } if ( $ assetId ) { return $ assetId ; } else { return parent :: _getAssetParentId ( $ table , $ id ) ; } }
Method to get the parent asset id for the record
 @param   JTable   $table  A JTable object for the asset parent
 @param   integer  $id
Method to get the parent asset id for the record @param JTable $table A JTable object for the asset parent @param integer $id
// Initialise variables. // This is a article under a category. // Build the query to get the asset id for the parent category. // Get the asset id from the database. // Return the asset id.