本文整理汇总了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();
}