I have an URL like example.org/overview/<column>/<value>
(example: example.org/overview/color/red
) which will cause a search in a column "color" for the value "red". This is the entity:
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
// @ORM\Entity(repositoryClass="App\Repository\CarRepository")
class Car
{
// @ORM\Column(type="string", length=255)
private $name;
private $color;
[...]
I think I should check if an entity property exists before I start a db query. How can I check when someone calls example.org/overview/foo/bar
if foo
is a valid db column (= entity property)? Does Symfony offer a simple solution here? If this might not be the case I think I have to use a hard coded white list.