We have two different servers. On one we have CMS and on the other we have frontend. Frontend server is based on Symfony.
We need to built up a caching mechanism/database insertion into the frontend server.
So far I have built up a MySql tables called static_content using doctrine.
And this is the structure inside the Static Content.
This is the current code which I have
public function parseAction() {
$staticContent = new StaticContent();
$staticContent->setData('html');
$doctrine = $this->getDoctrine()->getManager();
$doctrine->persist($staticContent);
$doctrine->flush();
return new Response($staticContent);
}
public function showExistationalAction($staticContentId) {
$staticContent = $this->getDoctrine()
->getRepository(StaticContent::class)
->find($staticContentId);
if(!$staticContent) {
throw $this->createNotFoundException(
'No html has been found'. $staticContentId
);
}
return new Response($staticContent->getData());
}
We are using Symfony 2.8 with MySql 5.7.
So my exact problem is how can I insert the whole web page to Data field in the StaticContent Entity ? Is there a variable which just saves the HTML content in Symfony ? What do I invoke instead of setData('html'); ? Actually I believe that I need guidance.

