Skip to content

Instantly share code, notes, and snippets.

View rileyrg's full-sized avatar
💭
Emacs can replace PHPStorm

RichieHH rileyrg

💭
Emacs can replace PHPStorm
  • Hamburg, Germany
View GitHub Profile
class PersonController extends VollFilmController
{
private $logger;
private $trans;
public function __construct(Translator $trans)
{
$this->trans = $trans;
class PersonController extends VollFilmController
{
private $logger;
public function __construct(LoggerInterface $log)
{
$this->logger = $log;
}
$queryBuilder = $this->createQueryBuilder('p')
->select("d.name,d.id")
->innerJoin('p.genresDancing', 'd')
->where('p=:person')
->setParameter('person', $person);
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):
'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);
$filterForm->handleRequest($request);
if ($filterForm->get('reset')->isClicked()) {
$this->addFlash(
'alert-warning',
$this->get("translator")->trans('filter.cleared', [], 'filter')
);
return new RedirectResponse($request->getPathInfo());
}
'choices'=> [
"person.sex0"=>0,
"person.sex1"=>1,
"person.sex2"=>2,
],
/**
* @ORM\Entity(repositoryClass="AppBundle\Repository\GenusRepository")
* @ORM\Table(name="genus")
*/
class Genus
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
private function renderFilteredPersonList(Request $request, QueryBuilder $queryB, $resetRoute)
{
$personForm = $this->createForm(PersonFilterType::class, null, [
'method' => 'GET'
]);
$personForm->handleRequest($request);
if ($personForm->get('reset')->isClicked()) {
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,