My function findByDimensions() works correctly in Controller but if I use it in the DataFixture class, it always returns null.
Code in controller:
$manager = $this->getDoctrine()->getEntityManager();
$smRepository = $manager->getRepository('Something\Repository');
$smRepository->findByDimensions(1, 2);
I got the correct object here. But if I use it in DataFixture class, I always get null:
public function load(ObjectManager $manager) {
....
$smRepository = $manager->getRepository('Something\Repository');
$smRepository->findByDimensions(1, 2);
....
}
Where should be the mistake? The first manager is of the class EntityManager, the second is ObjectManager from DataFixture class.