My entity class is like
class myData{
private $id;
private $dob;
public function getId()
{
return $this->id;
}
public function setDob($dob)
{
$this->dob = new \DateTime($dob);
return $this;
}
public function getDob()
{
return $this->dob;
}
}
and in my controller file I am accessing the data like below:
public function outputAction(){
$request = $this->get('request');
$formid = $request->query->get('formid');
$formData = $em->getRepository('acmedemoBundle:myData')->findById($formid);
}
I need to access the Dob field here. Please suggest how to access.
I am using Symfony 2.4