本文整理汇总了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();
}
示例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;
}
示例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();
}
示例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"> </th>
<th class="head0"> </th>
<th class="head1"> </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();
}