public function getQuestion($id)
    {
        /** @var TemplateInterface $template */
        foreach ($this->data as $template) {
            if ($template->getQuestion()->getId() == $id) {
                return $template;
            }
        }

        throw new NotFoundHttpException(sprintf('Id question %s not found', $id));
    }
public function getQuestion($id)
    {
        /** @var TemplateInterface $template */
        foreach ($this->data as $template) {
            if ($template->getQuestion()->getId() == $id) {
                return $template;
            }
        }

        throw new NotFoundHttpException(sprintf('Id question %s not found', $id));
    }
public function getQuestion ( $ id ) { /** @var TemplateInterface $template */ foreach ( $ this -> data as $ template ) { if ( $ template -> getQuestion ( ) -> getId ( ) == $ id ) { return $ template ; } } throw new NotFoundHttpException ( sprintf ( 'Id question %s not found' , $ id ) ) ; }
Get specific template by question id

@param integer $id

@return TemplateInterface
Get specific template by question id