Tark13
Tark13

Reputation: 11

How to create symfony model class inside the controller?

=============== MyManualController.php ===============

$mCC = $this->getDoctrine()->getManager(); 
$qCC = "CONFLICT QUERY HERE...";
$xCC = $mCC->getConnection()->prepare($qCC); 
$xCC->execute(); 
$sCC =
$xCC->fetchAll();

=============== Current Output ===============

[{
     "emp_name": "Sample"
     "adjustment": "0",
     "by_days": "10",
     "mos": "323",
     "by_mos": "0",
     "yrs": "27",
     "by_yrs": "0" 
}]

=============== Expected Output ===============

[{
    "emp_name": "Sample"
    "adjustment": 0,
    "by_days": 10,
    "mos": 323,
    "by_mos": 0,
    "yrs": 27,
    "by_yrs": 0 
}]

Upvotes: 1

Views: 439

Answers (1)

yoann lecrivain
yoann lecrivain

Reputation: 11

follow link https://symfony.com/doc/current/doctrine.html

you can create entity, or, follow doc for create manually class with example

Upvotes: 1

Related Questions