Este foro ya no está activo, así que no puedes publicar nuevas preguntas ni responder a las preguntas existentes.

Error flush en relación OneToOne

29 de febrero de 2016

Hola a todos,

Intento guardar dos entidades relacionadas OneToOne, los formularios se muestran correctamente pero al hacer flush me aparece el siguiente error:

An exception occurred while executing 'SELECT t0.id AS id1, t0.document_type AS document_type2, t0.document AS document3, t0.first_name AS first_name4, t0.last_name AS last_name5, t0.email AS email6, t0.sent_mail AS sent_mail7, t0.created_at AS created_at8, t0.update_at AS update_at9, t10.id AS id11, t10.address AS address12, t10.lat AS lat13, t10.lng AS lng14, t10.country AS country15, t10.locality AS locality16, t10.postal_code AS postal_code17, t10.created_at AS created_at18, t10.update_at AS update_at19, t10.person_id AS person_id20 FROM tb_person t0 LEFT JOIN tb_address t10 ON t10.person_id = t0.id WHERE t0.document IN (?, ?, ?, ?, ?, ?) LIMIT 1' with params ["CC", "111114", "jhn", "jhn", "[email protected]", {"address":"kml","lat":"987","lng":"9879","country":"nn","locality":"kjn","postal_code":"kjn"}]:
 
Notice: Array to string conversion

Esta parte {"address":"kml","lat":"987","lng":"9879","country":"nn","locality":"kjn","postal_code":"kjn"} es la entidad Address.

Agradezco si pueden ayudarme,

Saludos


Respuestas

#1

¿Cómo tienes configuradas las entidades?

@diegotham

29 febrero 2016, 21:35
#2

Hola @diegotham,

Gracias por responder, estas son las entidades :

class Person {
...
    /**
     * @ORM\OneToOne(targetEntity="AppBundle\Entity\Address", mappedBy="person", cascade={"persist", "remove"})
     */
    protected $address;
...
}
 
class Address {
...
    /**
     * @ORM\OneToOne(targetEntity="AppBundle\Entity\Person", inversedBy="address")
     * @ORM\JoinColumn(name="person_id", referencedColumnName="id")
     */
    protected $person;
...
}

@miguelplazasr

29 febrero 2016, 22:18