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


PHP JFactory::getDbO方法代码示例

本文整理汇总了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;
 }
开发者ID:shamusdougan,项目名称:GDMCWebsite,代码行数:25,代码来源:business.php

示例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];
 }
开发者ID:jeprodev,项目名称:jeproshop,代码行数:11,代码来源:group.php

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

示例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();
 }
开发者ID:night-coder,项目名称:ignite,代码行数:14,代码来源:profile.php


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