本文整理匯總了PHP中JFactory::getDbO方法的典型用法代碼示例。如果您正苦於以下問題:PHP JFactory::getDbO方法的具體用法?PHP JFactory::getDbO怎麽用?PHP JFactory::getDbO使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JFactory
的用法示例。
在下文中一共展示了JFactory::getDbO方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: validateUniqueValue
protected function validateUniqueValue()
{
if (!isset($this->form->saveresult) || $this->form->saveresult != 1) {
return true;
}
//validate unique field value in database
if (isset($this->field->uniquevaluesonly) && $this->field->uniquevaluesonly == 1) {
//get values of all recordsets in datatable
$details = array();
$db = JFactory::getDbO();
if (isset($this->field->id) && is_numeric($this->field->id)) {
$query = ' SELECT F' . $this->field->id . ' FROM #__visforms_' . $this->form->id;
$db->setQuery($query);
$details = $db->loadColumn();
}
//check if there is a match
if (in_array($this->field->dbValue, $details)) {
$this->field->isValid = false;
$app = JFactory::getApplication();
$app->enqueueMessage(JText::sprintf('COM_VISFORMS_UNIQUE_VALUE_REQUIRED', $this->field->label, $this->field->dbValue));
return false;
}
}
return true;
}
示例2: getPriceDisplayMethod
public static function getPriceDisplayMethod($group_id)
{
if (!isset(JeproshopGroupModelGroup::$group_price_display_method[$group_id])) {
$db = JFactory::getDbO();
$query = "SELECT " . $db->quoteName('price_display_method') . " FROM " . $db->quoteName('#__jeproshop_group');
$query .= " WHERE " . $db->quoteName('group_id') . " = " . (int) $group_id;
$db->setQuery($query);
self::$group_price_display_method[$group_id] = $db->loadResult();
}
return self::$group_price_display_method[$group_id];
}
示例3: getForm
/**
* Method to get the form
* @return object with data
* @since Joomla 1.6
*/
function getForm()
{
$db = JFactory::getDbO();
$query = ' SELECT * FROM #__visforms ' . ' WHERE id = ' . $this->_id;
$db->setQuery($query);
$form = $db->loadObject();
$registry = new JRegistry();
//Convert frontendsettings field to an array
$registry->loadString($form->frontendsettings);
$form->frontendsettings = $registry->toArray();
foreach ($form->frontendsettings as $name => $value) {
//make names shorter and set all frontendsettings as properties of form object
$form->{$name} = $value;
}
return $form;
}
示例4: getUserAvatars
/**
* TuiyoModelProfile::getUserAvatars()
* [OBSULATE!!]
* @return
*/
public function getUserAvatars()
{
$user = JFactory::getUser();
$dbo = JFactory::getDbO();
$query = "SELECT r.resourceID as id, r.url, r.fileTitle as title" . "\nFROM #__tuiyo_resources r" . "\nWHERE r.contentType='AVATAR' AND r.userID =" . $dbo->Quote((int) $user->id);
$dbo->setQuery($query);
//echo $dbo->getQuery();
return (array) $dbo->loadAssocList();
}