• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP DBObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中DBObject的典型用法代码示例。如果您正苦于以下问题:PHP DBObject类的具体用法?PHP DBObject怎么用?PHP DBObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DBObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 /** Constructor
  * @param {int} $prueba prueba id
  * @param {int} $jornada jornada id
  * @param {array} $mangas datos de la manga
  * @param {array} $results resultados asociados a la manga/categoria pedidas
  * @param {int} $mode manga mode
  * @throws Exception
  */
 function __construct($prueba, $jornada, $mangas, $results, $mode)
 {
     parent::__construct('Landscape', "print_clasificacion_eqBest", $prueba, $jornada);
     $dbobj = new DBObject("print_clasificacionEquipos");
     $this->manga1 = null;
     $this->manga2 = null;
     $this->trs1 = null;
     $this->trs2 = null;
     if ($mangas[0] != 0) {
         $this->manga1 = $dbobj->__getObject("Mangas", $mangas[0]);
         $this->trs1 = $results['trs1'];
     }
     if ($mangas[1] != 0) {
         $this->manga2 = $dbobj->__getObject("Mangas", $mangas[1]);
         $this->trs2 = $results['trs2'];
     }
     $this->categoria = $this->getModeString(intval($mode));
     $this->equipos = $results['equipos'];
     // recuerda que YA viene indexado por puesto
     // insertamos perros dentro de cada equipo.
     // para ello vamos a crear un array indexado por teamID
     $teams = array();
     foreach ($this->equipos as &$equipo) {
         $equipo['Perros'] = array();
         $teams[$equipo['ID']] = $equipo;
     }
     // iteramos los perros insertandolos en el equipo. Recuerda que los perros ya vienen ordenados
     foreach ($results['individual'] as &$perro) {
         array_push($teams[$perro['Equipo']]['Perros'], $perro);
     }
     $this->equipos = $teams;
 }
开发者ID:nedy13,项目名称:AgilityContest,代码行数:40,代码来源:print_clasificacion_equipos.php


示例2: __construct

 /**
  * Constructor
  * @param {integer} $prueba Prueba ID
  * @param {integer} $jornada Jormada ID
  * @param {integer} $manga Manga ID
  * @throws Exception
  */
 function __construct($prueba, $jornada)
 {
     parent::__construct('Portrait', "print_equiposByJornada", $prueba, $jornada);
     if ($prueba <= 0 || $jornada <= 0) {
         $this->errormsg = "print_teamsByJornada: either prueba or jornada data are invalid";
         throw new Exception($this->errormsg);
     }
     // comprobamos que estamos en una jornada por equipos
     $flag = intval($this->jornada->Equipos3) + intval($this->jornada->Equipos4);
     if ($flag == 0) {
         $this->errormsg = "print_teamsByJornada: Jornada {$jornada} has no Team competition declared";
         throw new Exception($this->errormsg);
     }
     // Datos de equipos de la jornada
     $m = new Equipos("print_teamsByJornada", $prueba, $jornada);
     $teams = $m->getTeamsByJornada();
     // reindexamos por ID y anyadimos un campo extra "Perros" con los perros del equipo
     $this->equipos = array();
     foreach ($teams as &$equipo) {
         $equipo['Perros'] = $m->getPerrosByTeam($equipo['ID']);
         $this->equipos[$equipo['ID']] = $equipo;
     }
     // Datos de los participantes (indexados por ID de perro)
     $m = new DBObject("print_teamsByJornada");
     $r = $m->__select("*", "Resultados", "(Jornada={$jornada})", "", "");
     $this->perros = array();
     foreach ($r['rows'] as $item) {
         $this->perros[intval($item['Perro'])] = $item;
     }
     // finalmente internacionalizamos cabeceras
     $this->cellHeader = array(_('Dorsal'), _('Name'), _('Breed'), _('Lic'), _('Category'), _('Handler'), $this->strClub, _('Heat'), _('Comments'));
 }
开发者ID:nedy13,项目名称:AgilityContest,代码行数:39,代码来源:print_equiposByJornada.php


示例3: __construct

 /** Constructor
  * @param {obj} $manga datos de la manga
  * @param {obj} $resultados resultados asociados a la manga/categoria pedidas
  * @throws Exception
  */
 function __construct($prueba, $jornada, $mangas)
 {
     parent::__construct('Portrait', "print_etiquetasPDF", $prueba, $jornada);
     $dbobj = new DBObject("print_etiquetas_pdf");
     $this->manga1 = $dbobj->__getObject("Mangas", $mangas[0]);
     $this->manga2 = $dbobj->__getObject("Mangas", $mangas[1]);
     // add version date and license serial to every label
     $ser = substr($this->regInfo['Serial'], 4, 4);
     $ver = substr($this->config->getEnv("version_date"), 2, 6);
     $this->serialno = "{$ver}-{$ser}";
 }
开发者ID:nedy13,项目名称:AgilityContest,代码行数:16,代码来源:print_etiquetas_pdf.php


示例4: getSettings

function getSettings()
{
    $db = new DBObject('cdc');
    $sql = "SELECT schoolyear, semester FROM settings LIMIT 1";
    if ($res = $db->query($sql)) {
        $settings = mysqli_fetch_assoc($res);
        return array('year' => intval($settings['schoolyear']), 'sem' => intval($settings['semester']));
    } else {
        return false;
    }
}
开发者ID:quo123,项目名称:ldc.spumanila.edu.dev,代码行数:11,代码来源:common.php


示例5: __construct

 /** Constructor
  * @param {int} $prueba
  * @param {int} $jornada
  * @param {array} $mangas lista de mangaid's
  * @param {array} $results resultados asociados a la manga pedidas
  * @throws Exception
  */
 function __construct($prueba, $jornada, $mangas, $results)
 {
     parent::__construct('Landscape', "print_podium", $prueba, $jornada);
     $dbobj = new DBObject("print_clasificacion");
     $this->manga1 = $dbobj->__getObject("Mangas", $mangas[0]);
     $this->manga2 = null;
     if ($mangas[1] != 0) {
         $this->manga2 = $dbobj->__getObject("Mangas", $mangas[1]);
     }
     $this->resultados = $results;
 }
开发者ID:nedy13,项目名称:AgilityContest,代码行数:18,代码来源:print_podium.php


示例6: create

 static function create($user_id, $payment_hash, $days, $amount)
 {
     $dbInsert = new DBObject("premium_order", array("user_id", "payment_hash", "days", "amount", "order_status", "date_created"));
     $dbInsert->user_id = $user_id;
     $dbInsert->payment_hash = $payment_hash;
     $dbInsert->days = $days;
     $dbInsert->amount = $amount;
     $dbInsert->order_status = 'pending';
     $dbInsert->date_created = date("Y-m-d H:i:s", time());
     if ($dbInsert->insert()) {
         return $dbInsert;
     }
     return false;
 }
开发者ID:farzam65,项目名称:YetiShare-File-Hosting-Script-Free,代码行数:14,代码来源:class.orderpeer.php


示例7: OnInsert

 /**
  * Safety net: in case the change is not given, let's guarantee that it will
  * be set to the current ongoing change (or create a new one)	
  */
 protected function OnInsert()
 {
     if ($this->Get('change') <= 0) {
         $this->Set('change', CMDBObject::GetCurrentChange());
     }
     parent::OnInsert();
 }
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:11,代码来源:cmdbchangeop.class.inc.php


示例8: _processSearch

 protected function _processSearch()
 {
     $class = $this->_getSearchClass();
     $table = DBObject::stGetTableName($class);
     $fieldId = $class::stGetFieldConfigFiltered(array("identifier" => true));
     $select = "SELECT {$this->fields} FROM {$table}";
     $where = "";
     foreach ($this->filters as $field => $filter) {
         $field = DBObject::stObjFieldToDBField($field);
         $op = $filter[0];
         if (is_array($filter[1])) {
             $whereField = "(";
             foreach ($filter[1] as $value) {
                 // TODO soporte para OR ?
                 $whereField = $whereField . "'" . $value . "'" . " AND ";
             }
             $whereField = substr($whereField, 0, -5) . ")";
         } else {
             $whereField = "'" . $filter[1] . "'";
         }
         $where = $where . $field . " " . $op . " " . $whereField . " AND ";
     }
     if ($where != "") {
         $select = $select . " WHERE " . substr($where, 0, -5);
     }
     $offset = ($this->page - 1) * $this->limit;
     $select = $select . " LIMIT {$offset},{$this->limit}";
     $mysqlParams = static::_stGetMySQLParams();
     $search = DBMySQLConnection::stVirtualConstructor($mysqlParams)->query($select);
     // Anotamos los resultados
     $this->count = $search->num_rows;
     // Guardamos la búsqueda
     $this->search = $search;
 }
开发者ID:jilgue,项目名称:ownWebAppServices,代码行数:34,代码来源:DBObjectSearch.php


示例9: MakeObjectURL

 public static function MakeObjectURL($sClass, $iId)
 {
     $sPage = DBObject::ComputeStandardUIPage($sClass);
     $sAbsoluteUrl = utils::GetAbsoluteUrlAppRoot();
     $sUrl = "{$sAbsoluteUrl}pages/{$sPage}?operation=details&class={$sClass}&id={$iId}";
     return $sUrl;
 }
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:7,代码来源:applicationcontext.class.inc.php


示例10: calculate

 public function calculate()
 {
     parent::calculate();
     // load records .. see $this->firstRecord, $this->perPage
     $limitSql = sprintf(' LIMIT %s,%s', $this->firstRecord, $this->perPage);
     $this->records = array_values(DBObject::glob($this->itemClass, $this->pageSql . $limitSql));
 }
开发者ID:hanigamal,项目名称:planetz,代码行数:7,代码来源:class.dbpager.php


示例11: render

 public function render($module, $model)
 {
     $rtn = "\n[[[\r\n  \$prepopulate = (\$object->isNew() ? (isset(\$_POST['" . $this->name . "']) ? strip_tags(\$_POST['" . $this->name . "']) : '') : \$object->get" . DBObject::tableNameToClassName($this->name) . "() * 1000);\r\n  \$alt_prepopulate = \$prepopulate;\r\n  if (preg_match('/^\\d+\$/', \$prepopulate)) {\r\n    \$alt_prepopulate = date('Y-m-d', \$prepopulate/1000);\r\n  }\r\n]]]\n";
     $id = get_random_string(5);
     $rtn .= "\n<div id='{$id}' class='form-group'>\r\n  <label class='col-sm-2 control-label' for='{$this->name}'>{$this->name} " . ($this->required ? $this->mandatory_field : '') . "</label>\r\n  <div class='col-sm-10'>\r\n    <div class='input-group'>\r\n      <span class='input-group-addon'><i class='fa fa-calendar'></i></span>\r\n      <input disabled='disabled' value='[[[ echo htmlentities(str_replace('\\'', '\"', \$alt_prepopulate)) ]]]' type='text' class='form-control altFormat' " . ($this->required ? ' required' : '') . " />\r\n      <input value='[[[ echo htmlentities(str_replace('\\'', '\"', \$prepopulate)) ]]]' type='text' id='{$this->name}' name='{$this->name}' class='datepicker form-control' " . ($this->required ? ' required' : '') . "  style='position: absolute; top:0; left: 0; z-index: -1' />\r\n    </div>\r\n  </div>\r\n</div>\r\n<div class='hr-line-dashed'></div>\r\n";
     $rtn .= "\r\n    <script type='text/javascript'>\r\n      \$('#{$id} .datepicker').datepicker({\r\n        " . (isset($this->options['dateFormat']) ? 'dateFormat: ' . "'" . $this->options['dateFormat'] . "'" : '') . "\r\n        " . (isset($this->options['altFormat']) ? ',altField: "#' . $id . ' .altFormat", altFormat: "' . $this->options['altFormat'] . '"' : '') . "\r\n        " . (isset($this->options['changeMonth']) ? ',changeMonth: ' . $this->options['changeMonth'] : '') . "\r\n        " . (isset($this->options['changeYear']) ? ',changeYear: ' . $this->options['changeYear'] : '') . "\r\n        " . (isset($this->options['yearRange']) ? ',yearRange: ' . "'" . $this->options['yearRange'] . "'" : '') . "\r\n      });\r\n      \$('#{$id} .input-group-addon').css('cursor', 'pointer').on('click', function(){\r\n        \$('#{$id} .datepicker').datepicker('show');\r\n      });\r\n    </script>\r\n";
     return $rtn;
 }
开发者ID:jeffreycai,项目名称:ct21,代码行数:8,代码来源:FormWidgetDatepicker.class.php


示例12: __construct

 /** Constructor
  * @param {int} $prueba prueba id
  * @param {int} $jornada jornada id
  * @param {array} $mangas datos de la manga
  * @param {array} $results resultados asociados a la manga/categoria pedidas
  * @param {int} $mode manga mode
  * @throws Exception
  */
 function __construct($prueba, $jornada, $mangas, $results, $mode)
 {
     parent::__construct('Landscape', "print_clasificacion", $prueba, $jornada);
     $dbobj = new DBObject("print_clasificacion");
     $this->manga1 = $dbobj->__getObject("Mangas", $mangas[0]);
     $this->manga2 = null;
     if ($mangas[1] != 0) {
         $this->manga2 = $dbobj->__getObject("Mangas", $mangas[1]);
     }
     $this->resultados = $results['rows'];
     $this->trs1 = $results['trs1'];
     $this->trs2 = null;
     if ($mangas[1] != 0) {
         $this->trs2 = $results['trs2'];
     }
     $this->categoria = $this->getModeString(intval($mode));
 }
开发者ID:nedy13,项目名称:AgilityContest,代码行数:25,代码来源:print_clasificacion.php


示例13: refresh

 public function refresh(DBObject $db, $table = 'userinfo', $fields = ['userid'], $status = 'status')
 {
     $sql = "SELECT * FROM {$table} WHERE {$fields[0]} = {$_SESSION[$fields[0]]}";
     if (($result = $db->query($sql)) && mysqli_num_rows($result) > 0) {
         $row = mysqli_fetch_assoc($result);
         if ($row[$status] == 0) {
             return false;
         }
         foreach ($fields as $field) {
             $_SESSION[$field] = $row[$field];
         }
         return true;
     } else {
         //			echo $db->getError();
         error_log($db->getError());
         return false;
     }
 }
开发者ID:quo123,项目名称:ldc.spumanila.edu.dev,代码行数:18,代码来源:MySessions.php


示例14: getDBColumnType

 function getDBColumnType($field)
 {
     $params = array_merge(array_keys($this->objFields), array_keys($this->params));
     $_params = array();
     foreach ($params as $param) {
         $_params[$param] = isset($this->{$param}) ? $this->{$param} : $this->objFields["{$param}"];
     }
     return "`" . DBObject::stObjFieldToDBField($field) . "` " . $this->_getDBColumnType($_params);
 }
开发者ID:jilgue,项目名称:ownWebAppServices,代码行数:9,代码来源:DataType.php


示例15: create

 static function create($username, $password, $email, $title, $firstname, $lastname, $accType = 'user')
 {
     $dbInsert = new DBObject("users", array("username", "password", "email", "title", "firstname", "lastname", "datecreated", "createdip", "status", "level", "paymentTracker"));
     $dbInsert->username = $username;
     $dbInsert->password = MD5($password);
     $dbInsert->email = $email;
     $dbInsert->title = $title;
     $dbInsert->firstname = $firstname;
     $dbInsert->lastname = $lastname;
     $dbInsert->datecreated = sqlDateTime();
     $dbInsert->createdip = getUsersIPAddress();
     $dbInsert->status = 'active';
     $dbInsert->level = 'free user';
     $dbInsert->paymentTracker = MD5(time() . $username);
     if ($dbInsert->insert()) {
         return $dbInsert;
     }
     return false;
 }
开发者ID:farzam65,项目名称:YetiShare-File-Hosting-Script-Free,代码行数:19,代码来源:class.userpeer.php


示例16: save

 function save()
 {
     if (empty($this->Creator)) {
         $this->Creator = $_SESSION['User'];
     }
     return parent::save();
 }
开发者ID:acdha,项目名称:impphp,代码行数:7,代码来源:DocumentVersion.php


示例17: __construct

 /**
  * Data constructor
  * 
  * @param int $id Optional - if set gets data from PID = $id
  * @param string $class Option - if set then sets className directly
  */
 public function __construct($id = NULL, $class = NULL)
 {
     if ($class) {
         $this->setClassName($class);
     }
     parent::__construct($id);
 }
开发者ID:uhtoff,项目名称:eCRF,代码行数:13,代码来源:Data.php


示例18: Exception

 /**
  * Constructor
  * @param {string} Name for this object
  * @param {integer} $manga Manga ID
  * @throws Exception when
  * - cannot contact database
  * - invalid manga ID
  */
 function __construct($file, $manga)
 {
     parent::__construct($file);
     if ($manga <= 0) {
         $this->errormsg = "Resultados::Construct invalid Manga ID: {$manga}";
         throw new Exception($this->errormsg);
     }
     $this->manga = $this->__getArray("Mangas", $manga);
     if (!is_array($this->manga)) {
         $this->errormsg = "OrdenSalida::construct(): Cannot get info on manga:{$manga}";
         throw new Exception($this->errormsg);
     }
     $this->jornada = $this->__getArray("Jornadas", $this->manga['Jornada']);
     if (!is_array($this->jornada)) {
         $this->errormsg = "OrdenSalida::construct(): Cannot get jornada info on jornada:{$this->manga['Jornada']} manga:{$manga}";
         throw new Exception($this->errormsg);
     }
     $this->prueba = $this->__getArray("Pruebas", $this->jornada['Prueba']);
     if (!is_array($this->prueba)) {
         $this->errormsg = "OrdenSalida::construct(): Cannot get prueba info on prueba:{$this->jornada['Prueba']} jornada:{$this->manga['Jornada']} manga:{$manga}";
         throw new Exception($this->errormsg);
     }
     $this->federation = Federations::getFederation(intval($this->prueba['RSCE']));
     if ($this->federation == null) {
         $this->errormsg = "OrdenSalida::construct(): Cannot get federation info on prueba:{$this->jornada['Prueba']} jornada:{$this->manga['Jornada']} manga:{$manga}";
         throw new Exception($this->errormsg);
     }
 }
开发者ID:nedy13,项目名称:AgilityContest,代码行数:36,代码来源:OrdenSalida.php


示例19: getConf

 /**
  * get configuration data for connecting to db
  * @return mixed
  */
 private static function getConf()
 {
     if (!self::$conf) {
         self::$conf = (require 'db.conf.php');
     }
     return self::$conf;
 }
开发者ID:Adidi,项目名称:DBObject,代码行数:11,代码来源:DBObject.php


示例20: __construct

 public function __construct($id = false)
 {
     if (empty($id)) {
         $this->Created = time();
         $this->Modified = time();
     }
     parent::__construct($id);
 }
开发者ID:acdha,项目名称:impphp,代码行数:8,代码来源:Document.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP DBObjectSearch类代码示例发布时间:2022-05-23
下一篇:
PHP DBModel类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap