This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PersonController extends VollFilmController | |
{ | |
private $logger; | |
private $trans; | |
public function __construct(Translator $trans) | |
{ | |
$this->trans = $trans; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PersonController extends VollFilmController | |
{ | |
private $logger; | |
public function __construct(LoggerInterface $log) | |
{ | |
$this->logger = $log; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$queryBuilder = $this->createQueryBuilder('p') | |
->select("d.name,d.id") | |
->innerJoin('p.genresDancing', 'd') | |
->where('p=:person') | |
->setParameter('person', $person); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT a.country_code,a.city,a.street from person p | |
Join adress_data a | |
on p.adress_data_id = a.id | |
JOIN country c | |
on c.code=a.country_code where c.code="DE" | |
My Symfony version: (not working): | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { | |
if (empty($values['value'])) { | |
return null; | |
} | |
$paramName = sprintf('p_%s', str_replace('.', '_', $field)); | |
// expression that represent the condition | |
$expression = $filterQuery->getExpr()->eq($field, ':' . $paramName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$filterForm->handleRequest($request); | |
if ($filterForm->get('reset')->isClicked()) { | |
$this->addFlash( | |
'alert-warning', | |
$this->get("translator")->trans('filter.cleared', [], 'filter') | |
); | |
return new RedirectResponse($request->getPathInfo()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'choices'=> [ | |
"person.sex0"=>0, | |
"person.sex1"=>1, | |
"person.sex2"=>2, | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @ORM\Entity(repositoryClass="AppBundle\Repository\GenusRepository") | |
* @ORM\Table(name="genus") | |
*/ | |
class Genus | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="AUTO") | |
* @ORM\Column(type="integer") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function renderFilteredPersonList(Request $request, QueryBuilder $queryB, $resetRoute) | |
{ | |
$personForm = $this->createForm(PersonFilterType::class, null, [ | |
'method' => 'GET' | |
]); | |
$personForm->handleRequest($request); | |
if ($personForm->get('reset')->isClicked()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `user` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`nickname` varchar(50) DEFAULT NULL, | |
`first_name` varchar(255) DEFAULT NULL, | |
`last_name` varchar(255) DEFAULT NULL, | |
`email` varchar(255) DEFAULT NULL, | |
`sha1_password` varchar(40) DEFAULT NULL, | |
`salt` varchar(32) DEFAULT NULL, | |
`activation_code` varchar(64) DEFAULT NULL, | |
`activated` int(11) DEFAULT NULL, |