Allality
Новичок
Пробую подключиться к БД MySQL, но всегда получаю Null.
Контроллер:
	
	
	
		
Выдает ошибку:
Error: Call to a member function getContentHtml() on null
dump ($article) выдает:
in DefaultController.php line 26:
null
Подскажите, в чем здесь проблема?
								Контроллер:
		PHP:
	
	<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use AppBundle\Entity\Article;
class DefaultController extends Controller
{
    /**
     * @Route("/{articleUrl}", name="show", requirements={"articleUrl"=".*"})
     */
    public function indexAction(Request $request, $articleUrl)
    {
        $article = $this->getDoctrine()
        ->getRepository('AppBundle:Article') // Сущность src\AppBundle\Entity\Article.php
        ->find(1);
        $articleContent = $article->getContentHtml(); // геттер
        return $this->render('base.html.twig', array(
            'articleUrl' => $articleUrl
        ));
    }
}
	Выдает ошибку:
Error: Call to a member function getContentHtml() on null
dump ($article) выдает:
in DefaultController.php line 26:
null
Подскажите, в чем здесь проблема?
	            