php - Type error: Argument 1 passed Chat::__construc t() must be an instance of DoctrineORMEntityManager, none given, called in
Get the solution ↓↓↓Solution:
The error occurs because you've defined the constructor as:
public function __construct(EntityManager $em) {
$this->clients = new \SplObjectStorage;
//$this->container = $container;
$this->em = $em;
}
So then you'll need to get an entity manager something like this:
$em = $this->getDoctrine()->getManager();
and then pass this in when you create your new object like so:
new Chat( $em )
So you'll need to figure out how to do that.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: cannot set properties of undefined (setting '_dt_cellindex')
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.