本文整理汇总了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
}