本文整理匯總了PHP中app\Article::getClassName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Article::getClassName方法的具體用法?PHP Article::getClassName怎麽用?PHP Article::getClassName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Article
的用法示例。
在下文中一共展示了Article::getClassName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionDoctrineExample
public function actionDoctrineExample()
{
$articles = $this->em->getDao(Article::getClassName());
$article = new Article();
$article->title = "The Fight Club";
$articles->save($article);
$article = $articles->find(1);
$this->template->article = $article->title;
Debugger::dump($article);
$this->redirect('Homepage:default');
}
示例2: renderDefault
public function renderDefault()
{
$this->template->anyVariable = 'any value';
$dao = $this->EntityManager->getRepository(Article::getClassName());
$this->template->articles = $dao->findAll();
// $post = new Posts();
// $post->title = 'New title';
// $post->text = 'New text New textNew text';
// $post->created_at = new \Nette\Utils\DateTime;
//
//
// $this->EntityManager->persist($post);
// $this->EntityManager->flush();
// $dao = $this->EntityManager->getRepository(Posts::getClassName());
// $dao->setTitle('test');
// $dao->__call('set', ['title' => 'my title']);
// dump($dao->__isset('title'));
// $dao->__set('title', 'test');
}
示例3: __construct
public function __construct(Kdyby\Doctrine\EntityManager $em)
{
$this->em = $em;
$this->articles = $em->getRepository(Article::getClassName());
// $this->articles = $em->getRepository(App\Article::getClassName()); // for older PHP
}