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


PHP News::id方法代码示例

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


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

示例1: update

 protected function update(News $news)
 {
     $requete = $this->db->prepare('UPDATE news SET auteur = :auteur, titre = :titre, contenu = :contenu, dateModif = NOW() WHERE id = :id');
     $requete->bindValue(':titre', $news->titre());
     $requete->bindValue(':auteur', $news->auteur());
     $requete->bindValue(':contenu', $news->contenu());
     $requete->bindValue(':id', $news->id(), PDO::PARAM_INT);
     $requete->execute();
 }
开发者ID:Guikingone,项目名称:JVN-Network,代码行数:9,代码来源:NewsManagerPDO.class.php

示例2: commit

 public function commit()
 {
     if ($this->valid_origin) {
         $nv = new NewsValidate(array('writer' => $this->writer, 'target' => $this->target, 'image' => $this->image, 'origin' => $this->origin, 'title' => $this->title, 'content' => $this->content, 'begin' => $this->begin, 'end' => $this->end, 'comment' => $this->comment));
         $v = new Validate(array('writer' => $this->writer, 'group' => $this->target->group(), 'item' => $nv, 'type' => 'news'));
         $v->insert();
     } else {
         $n = new News();
         $n->insert();
         $n->writer($this->writer);
         $n->target($this->target);
         $n->image($this->image);
         $n->origin($this->origin);
         $n->title($this->title);
         $n->content($this->content);
         $n->begin($this->begin);
         $n->end($this->end);
         $n->comment($this->comment);
         $this->idIfValid = $n->id();
         // This code is used to post news on a newsgroup server
         //if ($this->target->rights()->isMe(Rights::everybody())) {
         //    $this->sendnewsgroupmail();
         //}
     }
     return true;
 }
开发者ID:netixx,项目名称:frankiz,代码行数:26,代码来源:newsvalidate.php

示例3: update

 /**
  * @see NewsManager::update()
  */
 protected function update(News $news)
 {
     $requete = $this->db->prepare('UPDATE news SET auteur = ?, titre = ?, contenu = ?, dateModif = NOW() WHERE id = ?');
     $requete->bind_param('sssi', $news->auteur(), $news->titre(), $news->contenu(), $news->id());
     $requete->execute();
 }
开发者ID:benjarr,项目名称:poo-php-systeme_de_news,代码行数:9,代码来源:NewsManagerMySQLi.php

示例4: viewTable

function viewTable($data, $count)
{
    $news = new News();
    $paginations = new Paginations();
    $paginations->setLimit(10);
    $paginations->setPage($_REQUEST['page']);
    $paginations->setJSCallback("viewNews");
    $paginations->setTotalPages($count);
    $paginations->makePagination();
    ?>
    <div class="mws-panel-header">
        <span class="mws-i-24 i-table-1">View News</span>
    </div>
<div class="mws-panel-body">
    <table cellpadding="0" cellspacing="0" border="0" class="mws-datatable-fn mws-table">
        <colgroup>
            <col class="con0"/>
            <col class="con1"/>
        </colgroup>
        <thead>
        <tr>
            <th class="head1">News Title</th>
            <th class="head0">&nbsp;</th>
            <th class="head0">&nbsp;</th>
            <th class="head1">&nbsp;</th>
        </tr>
        </thead>
        <tbody>
        <?php 
    if (count($data) > 0) {
        ?>

            <?php 
        for ($i = 0; $i < count($data); $i++) {
            $news->extractor($data, $i);
            ?>
                <tr id="row_<?php 
            echo $news->id();
            ?>
">
                    <td class="con1"><?php 
            echo $news->title();
            ?>
</td>
                    <td class="con0"><?php 
            //echo $news->image();
            ?>
</td>
                    <td class="con0"><?php 
            //echo $admins->username();
            ?>
</td>
                    <td class="center"><a onclick="loadGUIContent('news','edit','<?php 
            echo $news->id();
            ?>
')">Edit</a>
                        <a onclick="deleteNews(<?php 
            echo $news->id();
            ?>
)" class="toggle">Delete</a></td>
                </tr>
            <?php 
        }
        ?>

        <?php 
    }
    ?>
        </tbody>
    </table>
    <?php 
    $paginations->drawPagination();
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:73,代码来源:news-controller.php


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