/** * @param ContainerInterface $container * @return TeacherService */ public function __invoke(ContainerInterface $container) { $adapter = $container->get('DbAdapter'); $entityPrototype = new TeacherEntity(); $mapper = new Mapper($adapter, $entityPrototype); $mapper->setEntityTable('teacher'); return new TeacherService($mapper, $entityPrototype); }
/** * @param ContainerInterface $container * @return StudentService */ public function __invoke(ContainerInterface $container) { $adapter = $container->get('DbAdapter'); $entityPrototype = new StudentEntity(); $collectionPrototype = new Collection(); $mapper = new Mapper($adapter, $entityPrototype, null, $collectionPrototype); $mapper->setEntityTable('student'); return new StudentService($mapper, $entityPrototype); }