本文整理匯總了PHP中JHelperContent::getLanguageId方法的典型用法代碼示例。如果您正苦於以下問題:PHP JHelperContent::getLanguageId方法的具體用法?PHP JHelperContent::getLanguageId怎麽用?PHP JHelperContent::getLanguageId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JHelperContent
的用法示例。
在下文中一共展示了JHelperContent::getLanguageId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: store
/**
* Store data to the appropriate table
*
* @param array $data Data to be stored
* @param JTableInterface $table JTable Object
* @param boolean $primaryKey Flag that is true for data that are using #__ucm_content as their primary table
*
* @return boolean true on success
*
* @since 3.1
*/
protected function store($data, JTableInterface $table = null, $primaryKey = null)
{
$table = $table ? $table : JTable::getInstance('Corecontent');
$typeId = $this->getType()->type->type_id;
$primaryKey = $primaryKey ? $primaryKey : $this->getPrimaryKey($typeId, $data['core_content_item_id']);
if (!$primaryKey) {
// Store the core UCM mappings
$baseData = array();
$baseData['ucm_type_id'] = $typeId;
$baseData['ucm_item_id'] = $data['core_content_item_id'];
$baseData['ucm_language_id'] = JHelperContent::getLanguageId($data['core_language']);
if (parent::store($baseData)) {
$primaryKey = $this->getPrimaryKey($typeId, $data['core_content_item_id']);
}
}
return parent::store($data, $table, $primaryKey);
}
示例2: storeUcmBase
/**
* Insert or update row in ucm_base table
*
* @param boolean $updateNulls True to update fields even if they are null.
* @param boolean $isNew if true, need to insert. Otherwise update.
*
* @return boolean True on success.
*
* @since 3.1
*/
protected function storeUcmBase($updateNulls = false, $isNew = false)
{
// Store the ucm_base row
$db = $this->getDbo();
$query = $db->getQuery(true);
$languageId = JHelperContent::getLanguageId($this->core_language);
// Selecting "all languages" doesn't give a language id - we can't store a blank string in non mysql databases, so save 0 (the default value)
if (!$languageId) {
$languageId = '0';
}
if ($isNew) {
$query->insert($db->quoteName('#__ucm_base'))->columns(array($db->quoteName('ucm_id'), $db->quoteName('ucm_item_id'), $db->quoteName('ucm_type_id'), $db->quoteName('ucm_language_id')))->values($db->quote($this->core_content_id) . ', ' . $db->quote($this->core_content_item_id) . ', ' . $db->quote($this->core_type_id) . ', ' . $db->quote($languageId));
} else {
$query->update($db->quoteName('#__ucm_base'))->set($db->quoteName('ucm_item_id') . ' = ' . $db->quote($this->core_content_item_id))->set($db->quoteName('ucm_type_id') . ' = ' . $db->quote($this->core_type_id))->set($db->quoteName('ucm_language_id') . ' = ' . $db->quote($languageId))->where($db->quoteName('ucm_id') . ' = ' . $db->quote($this->core_content_id));
}
$db->setQuery($query);
return $db->execute();
}
示例3: mapBase
/**
* Method to map the base ucm fields
*
* @param array $original Data array
* @param JUcmType $type UCM Content Type
*
* @return array Data array of UCM mappings
*
* @since 3.1
*/
public function mapBase($original, JUcmType $type = null)
{
$type = $type ? $type : $this->type;
$data = array('ucm_type_id' => $type->id, 'ucm_item_id' => $original[$type->primary_key], 'ucm_language_id' => JHelperContent::getLanguageId($original['language']));
return $data;
}
示例4: storeUcmBase
/**
* Insert or update row in ucm_base table
*
* @param boolean $updateNulls True to update fields even if they are null.
* @param boolean $isNew if true, need to insert. Otherwise update.
*
* @return boolean True on success.
*
* @since 3.1
*/
protected function storeUcmBase($updateNulls = false, $isNew = false)
{
// Store the ucm_base row
$db = $this->getDbo();
$query = $db->getQuery(true);
$languageId = JHelperContent::getLanguageId($this->core_language);
if ($isNew) {
$query->insert($db->quoteName('#__content_ucm_base'))->columns(array($db->quoteName('ucm_id'), $db->quoteName('ucm_item_id'), $db->quoteName('ucm_type_id'), $db->quoteName('ucm_language_id')))->values($db->quote($this->core_content_id) . ', ' . $db->quote($this->core_content_item_id) . ', ' . $db->quote($this->core_type_id) . ', ' . $db->quote($languageId));
} else {
$query->update($db->quoteName('#__content_ucm_base'))->set($db->quoteName('ucm_item_id') . ' = ' . $db->quote($this->core_content_item_id))->set($db->quoteName('ucm_type_id') . ' = ' . $db->quote($this->core_type_id))->set($db->quoteName('ucm_language_id') . ' = ' . $db->quote($languageId))->where($db->quoteName('ucm_id') . ' = ' . $db->quote($this->core_content_id));
}
$db->setQuery($query);
return $db->execute();
}