本文整理汇总了PHP中news::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP news::setTitle方法的具体用法?PHP news::setTitle怎么用?PHP news::setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类news
的用法示例。
在下文中一共展示了news::setTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
public function load(ObjectManager $manager)
{
$information = new Information();
$information->setTitle("About Me");
$information->setBody("<p>Rofilde Hasudungan research are in DNA based Computer</p>");
$information->setPublished(true);
$manager->persist($information);
$news = new news();
$news->setTitle("About Me");
$news->setBody("<p>Rofilde Hasudungan research are in DNA based Computer</p>");
$news->setPublished(true);
$manager->persist($news);
$manager->flush();
}
示例2: getAllAsObject
public function getAllAsObject($restriction = '')
{
$sql = "SELECT *\n\t\t\t FROM news \n\t\t\t WHERE 1=1 ";
$sql .= $restriction . ";";
try {
$result = mysql_query($sql);
if (!$result) {
throw new MysqlException();
}
$newsn = array();
while ($row = mysql_fetch_assoc($result)) {
$n = new news();
$n->setId($row['news_id']);
$n->setDatum($row['datum']);
$n->setTitle($row['title']);
$n->setTextfield($row['textfield']);
$newsn[$n->getId()] = $n;
}
} catch (MysqlException $e) {
Html::showAll($e);
}
return $newsn;
}