Skip to content

Instantly share code, notes, and snippets.

@farconada
Created January 19, 2015 19:20
Show Gist options
  • Save farconada/7b3327a7ddc23a6501af to your computer and use it in GitHub Desktop.
Save farconada/7b3327a7ddc23a6501af to your computer and use it in GitHub Desktop.
Doctrine 2.5-dev getLoadedMetadata() returns entries that arent ClassMetadataInfo
// Loads NewProductCommand into Class Metadata
public function indexAction()
{
$productCollection = $this->productRepository->findAll();
$response = $this->responseGenerator->okResponse();
$response->setContent(
$this->templating->render('FerOwnShopUIBackendBundle:Product:index.html.twig',
[
'productCollection' => $productCollection,
'newProductForm' => $this->formManager->getFormView(
new NewProductCommandFormType($this->taxRateChoices))
]
)
);
return $response;
}
// Loads SaveTagCommand into Class Metadata
public function indexAction()
{
$tagCollection = $this->entityRepository->findAll();
$response = $this->responseGenerator->okResponse();
$response->setContent(
$this->templating->render('FerOwnShopUIBackendBundle:Tag:index.html.twig',
[
'tagsCollection' => $tagCollection,
'form' => $this->formManager->getFormView(new SaveTagCommandFormType(), new SaveTagCommand())
]
)
);
return $response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment