當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Forum::getId方法代碼示例

本文整理匯總了PHP中Forum::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Forum::getId方法的具體用法?PHP Forum::getId怎麽用?PHP Forum::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Forum的用法示例。


在下文中一共展示了Forum::getId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: inserir

 public function inserir(Forum $forum)
 {
     //Objetivo deste metodo é inserir um objeto no banco, fazendo-o ter persistencia.
     //utilizaremos a abstracao do SQL da classe TsqlInstruction
     //1. Foreach dos atributos . PRa cada existencia de atributo é um valor a ser adicionado.
     $instrucao = new TSqlInsert();
     $instrucao->setEntity("forum");
     if ($forum->getId() != null) {
         $instrucao->setRowData("id", $forum->getId());
     }
     if ($forum->getTitulo() != null) {
         $instrucao->setRowData("titulo", $forum->getTitulo());
     }
     if ($forum->getCorpo() != null) {
         $instrucao->setRowData("corpo", $forum->getCorpo());
     }
     if ($forum->getUsuario() != null) {
         $instrucao->setRowData("usuario", $forum->getUsuario());
     }
     echo $instrucao->getInstruction();
     if ($this->Conexao->query($instrucao->getInstruction())) {
         return true;
     } else {
         return false;
     }
 }
開發者ID:joseolinda,項目名稱:escritordesoftware,代碼行數:26,代碼來源:ForumDAO.class.php

示例2: bindTopic

 /**
  * Permet de Charger tout les topics d'un forum
  * @param forum Forum dont on doit charger les topics
  * @since 1.0.0
  */
 public function bindTopic(Forum $forum)
 {
     $sql = "SELECT topic_id id, topic_titre titre, topic_vu vu, topic_genre genre\n\t\t\t\tFROM topic\n\t\t\t\tWHERE id_forum = :id";
     $id_forum = $forum->getId();
     $req = $this->bdd->prepare($sql);
     $req->bindParam(":id", $id_forum);
     $res = $req->execute();
     if (!$res) {
         return false;
     }
     $topics = $req->fetchAll(PDO::FETCH_OBJ);
     foreach ($topics as $topic) {
         $forum->addTopic(new Topic($topic->id, $topic->titre, NULL, $topic->vu, $topic->genre));
     }
 }
開發者ID:dederobert,項目名稱:Forum,代碼行數:20,代碼來源:ForumDAO.php

示例3: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Forum $value A Forum object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Forum $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
開發者ID:rayku,項目名稱:rayku,代碼行數:22,代碼來源:BaseForumPeer.php


注:本文中的Forum::getId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。