I have the following model:
use Doctrine\ORM\Mapping as ORM;
/**
* SignosGuion
*
* @ORM\Entity
* @ORM\Table(name="vw_signos_guion")
*/
class SignosGuion {
/**
* @var float
*
* @ORM\Column(name="id", type="float", nullable=false)
* @ORM\Id
*/
private $id;
/**
* @var float
*
* @ORM\Column(name="codigo", type="float", nullable=false)
*/
private $codigo;
// Getters and Setters...
}
This model corresponds to a view in my MySQL database.
When I do
$request = Request::createFromGlobals();
$idSignoGuion = (float) $request->query->get('idSignoGuion');
var_dump($idSignoGuion); // Imprime float(1.05)
$signosGuionRepository = $this->getDoctrine()->getRepository(SignosGuion::class);
$signoGuion = $signosGuionRepository->findOneBy(array('id' => $idSignoGuion));
$signoGuion2 = $signosGuionRepository->find($idSignoGuion);
var_dump($signoGuion); // Imprime NULL
var_dump($signoGuion2); // Imprime NULL
As I said above, both results bring me NULL, I tried:
If someone could give me a hand I would appreciate it very much.