Catchable Fatal Error: Argument 1 passed to taller\tallerBundle\Entity\vehiculo::setCliente() must be an instance of taller\tallerBundle\Entity\cliente, array given, called in C:\xampp\htdocs\symfony\vendor\symfony\symfony\src \Symfony\Component\PropertyAccess\PropertyAccessor .php on line 442 and defined
500 Internal Server Error - ContextErrorException
en el controlador tengo esto:
Código PHP:
.....
$cliente = new cliente();
$vehiculo = new vehiculo();
$form = $this-> createForm(new vehiculoType(), $vehiculo);
$form -> handleRequest($request);
if ($form ->isvalid()) {
$em = $this -> getDoctrine()-> getManager();
$em -> persist($cliente);
$em -> persist($vehiculo);
$em -> flush();
.....
Código PHP:
...
private $cliente;
/**
* Set cliente
*
* @param \taller\tallerBundle\Entity\cliente $cliente
* @return vehiculo
*/
public function setCliente(tallertallerBundleEntitycliente $cliente = null)
{
$this->cliente = $cliente;
return $this;
}
/**
* Get cliente
*
* @return \taller\tallerBundle\Entity\cliente
*/
public function getCliente()
{
return $this->cliente;
}
..
saludos