本文整理匯總了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;
}