Bonjour à tous,



Je débutes sous SF2 et j'ai un soucis avec une relation ManyToMany entre deux tables :

Messages(Propriétaires) et User(inverse)

Voici la déclaration de mes entités

Messages:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
 
namespace Ltr\IntranetBundle\Entity;
 
use Doctrine\ORM\Mapping as ORM;
 
/**
* @ORM\Entity
*/
 
class Messages
{
    /**
* @ORM\ManyToMany(targetEntity="Ltr\UserBundle\Entity\User",
cascade={"persist"}) 
*/
private $utilisateurs;
 
    /**
     * @var integer
     */
    private $id;
 
    /**
     * @var string
     */
    private $contenu;
 
    /**
     * @var \DateTime
     */
    private $dateCree;
 
    /**
     * @var string
     */
    private $objet;
 
 
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }
 
    /**
     * Set contenu
     *
     * @param string $contenu
     * @return Messages
     */
    public function setContenu($contenu)
    {
        $this->contenu = $contenu;
 
        return $this;
    }
 
    /**
     * Get contenu
     *
     * @return string 
     */
    public function getContenu()
    {
        return $this->contenu;
    }
 
    /**
     * Set dateCree
     *
     * @param \DateTime $dateCree
     * @return Messages
     */
    public function setDateCree($dateCree)
    {
        $this->dateCree = $dateCree;
 
        return $this;
    }
 
    /**
     * Get dateCree
     *
     * @return \DateTime 
     */
    public function getDateCree()
    {
        return $this->dateCree;
    }
 
    /**
     * Set objet
     *
     * @param string $objet
     * @return Messages
     */
    public function setObjet($objet)
    {
        $this->objet = $objet;
 
        return $this;
    }
 
    /**
     * Get objet
     *
     * @return string 
     */
    public function getObjet()
    {
        return $this->objet;
    }
}
User

Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
namespace Ltr\UserBundle\Entity;
 
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
 
/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;
 
    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255,nullable=true)
     */
 
    private $nom;
 
    /**
     * @var string
     *
     * @ORM\Column(name="prenom", type="string", length=255,nullable=true)
     */
    private $prenom;
 
    /**
     * @var string
     *
     * @ORM\Column(name="nomprenom", type="string", length=255,nullable=true)
     */
    private $nomprenom;
 
    /**
     * @var \DateTime
     *
     * @ORM\Column(name="datenaissance", type="date",nullable=true,nullable=true)
     */
    private $datenaissance;
 
    /**
     * @var string
     *
     * @ORM\Column(name="adresse1", type="string", length=255,nullable=true)
     */
    private $adresse1;
 
    /**
     * @var string
     *
     * @ORM\Column(name="adresse2", type="string", length=255,nullable=true)
     */
    private $adresse2;
 
    /**
     * @var string
     *
     * @ORM\Column(name="codepostal", type="string", length=10,nullable=true)
     */
    private $codepostal;
 
    /**
     * @var string
     *
     * @ORM\Column(name="ville", type="string", length=55,nullable=true)
     */
    private $ville;
 
    /**
     * @var string
     *
     * @ORM\Column(name="telephone", type="string", length=20,nullable=true)
     */
    private $telephone;
 
    /**
     * @var string
     *
     * @ORM\Column(name="portable", type="string", length=20,nullable=true)
     */
    private $portable;
 
    /**
     * @var string
     *
     * @ORM\Column(name="numinterne", type="string", length=10,nullable=true)
     */
    private $numinterne;
 
    /**
     * @var string
     *
     * @ORM\Column(name="observations", type="text",nullable=true)
     */
    private $observations;
 
 
}



Le problème c'est que ma table d'association ne se crée pas...la commande doctrine:schema:update m'indique que ma BDD est déjà à jour...



Une idée ?

Merci