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


PHP Report::setID方法代码示例

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


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

示例1: loadAll

 /**
  * Carica da database tutti i report per l'oggetto passato e li salva nell'oggetto.
  * @param Editable $object un oggetto di cui si possono caricare i report.
  * @return l'oggetto aggiornato 
  */
 function loadAll($object)
 {
     parent::load($object);
     $objectClass = get_class($object);
     $rs = $this->db->execute($s = Query::generateSelectStm(array($this->table), array(), array(new WhereConstraint($this->table->getColumn(REPORT_OBJECT_ID), Operator::EQUAL, $object->getID()), new WhereConstraint($this->table->getColumn(REPORT_OBJECT_CLASS), Operator::EQUAL, get_class($object))), array()));
     $reports = array();
     while ($row = $this->db->fetch_result()) {
         $report = new Report(intval($row[DB::REPORT_USER]), $object, $row[DB::REPORT_TEXT]);
         $report->setID($row[REPORT_ID]);
         $reports[] = $report;
     }
     return $object->setReports($reports);
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:18,代码来源:ReportDao.php

示例2: loadReports

 /**
  * Carica in this i report recuperati dal database per questo post (deve avere un ID!).
  */
 function loadReports()
 {
     require_once "query.php";
     $db = new DBManager();
     if (!$db->connect_errno()) {
         define_tables();
         defineReportColumns();
         $table = Query::getDBSchema()->getTable(TABLE_REPORT);
         $rs = $db->execute($s = Query::generateSelectStm(array($table), array(), array(new WhereConstraint($table->getColumn(REPORT_POST), Operator::EQUAL, $this->getID())), array()), $table->getName(), $this);
         if ($rs !== false) {
             $reports = array();
             while ($row = $db->fetch_result()) {
                 require_once "common.php";
                 $report = new Report(intval($row[REPORT_USER]), intval($row[REPORT_POST]), $row[REPORT_TEXT]);
                 $report->setID($row[REPORT_ID]);
                 $reports[] = $report;
             }
             $this->setReports($reports);
         } else {
             if ($db->errno()) {
                 $db->display_error("Post::loadReports()");
             }
         }
     } else {
         $db->display_connect_error("Post::loadReports()");
     }
     return $this;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:31,代码来源:Post.php

示例3: reportPost

 private function reportPost()
 {
     $report = new Report();
     //update if an id exists
     if (isset($this->request['id'])) {
         $report->setID($this->request['id']);
     }
     $report->setDescription($this->request['description']);
     //given name. get id
     $report->setInvolvementKindID(getInvolvementKindID($this->request['involvementKind']));
     //given name. get id
     $report->setReportKindID(getReportKindID($this->request['reportKind']));
     //set up location
     if (!$this->requestFieldsSubmitted(["buildingName"])) {
         $this->response['message'] = "error: missing location information";
         $this->response['code'] = 400;
     }
     $locID = $this->setUpLocation();
     if ($locID != -1) {
         $report->setLocationID($locID);
     } else {
         $this->response['message'] = "error: invalid location information";
         $this->response['code'] = 400;
     }
     //set up person
     if (!$this->requestFieldsSubmitted(["personKind", "username", "name", "phone"])) {
         $this->response['message'] = "error: missing person information";
         $this->response['code'] = 400;
     }
     $personID = $this->setUpPerson();
     if ($personID != -1) {
         $report->setPersonID($personID);
     } else {
         $this->response['message'] = "error: invalid person data";
         $this->response['code'] = 400;
     }
     //given dept name. get id
     $report->setDepartmentID(getDepartmentID($this->request['department']));
     $report->setDateTime($this->request['dateTime']);
     $report->setStatusID($this->request['statusID']);
     $report->setActionTaken($this->request['actionTaken']);
     $report->save();
     //return the report item in array format
     return $report->toArray();
 }
开发者ID:JakeDawkins,项目名称:NiceCatch,代码行数:45,代码来源:class.NiceCatchAPI.php


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