IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Symfony PHP Discussion :

Problème avec FOS User Bundle setLastLogin [2.x]


Sujet :

Symfony PHP

  1. #1
    Membre du Club
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 96
    Points : 48
    Points
    48
    Par défaut Problème avec FOS User Bundle setLastLogin
    Bonjour à tous

    Je suis en train de suivre un tutoriel sur un forum, et je suis confronté a un problème qu'il ne mentionne pas.

    Fatal error: Declaration of mybundle\UserBundle\Entity\User::setLastLogin() must be compatible with that of FOS\UserBundle\Model\UserInterface::setLastLogin() in C:\wamp\www\mysite\src\mybundle\UserBundle\Entity\User.php on line 12

    Mon entité user est comme suit :

    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
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    <?php
     
    namespace mySite\UserBundle\Entity;
     
    use Doctrine\ORM\Mapping as ORM;
    use FOS\UserBundle\Entity\User as BaseUser;
    use FOS\UserBundle\Model\UserInterface ;
     
    /**
     * mySite\UserBundle\Entity\User
     */
    class User extends BaseUser
    {
        /**
         * @var integer $id
         */
        protected $id;
     
        /**
         * @var string $name
         */
        private $name;
     
        /**
         * @var string $surname
         */
        private $surname;
     
        /**
         * @var date $dateBirth
         */
        private $dateBirth;
     
        /**
         * @var string $phone
         */
        private $phone;
     
        /**
         * @var integer $civility
         */
        private $civility;
     
        /**
         * @var integer $nationnality
         */
        private $nationnality;
     
        /**
         * @var string $email
         */
        protected $email;
     
        /**
         * @var integer $school
         */
        private $school;
     
        /**
         * @var integer $language
         */
        private $language;
     
        /**
         * @var string $description
         */
        private $description;
     
        /**
         * @var integer $interest
         */
        private $interest;
     
        /**
         * @var integer $lodgement
         */
        private $lodgement;
     
        /**
         * @var integer $photo
         */
        private $photo;
     
        /**
         * @var integer $adress
         */
        private $adress;
     
        /**
         * @var string $usernameCanonical
         */
        protected $usernameCanonical;
     
        /**
         * @var string $password
         */
        protected $password;
     
        /**
         * @var string $username
         */
        protected $username;
     
        /**
         * @var string $emailCanonical
         */
        protected $emailCanonical;
     
        /**
         * @var boolean $enabled
         */
        protected $enabled;
     
        /**
         * @var string $salt
         */
        protected $salt;
     
        /**
         * @var datetime $lastLogin
         */
        protected $lastLogin;
     
        /**
         * @var boolean $locked
         */
        protected $locked;
     
        /**
         * @var boolean $expired
         */
        protected $expired;
     
        /**
         * @var datetime $expiresAt
         */
        protected $expiresAt;
     
        /**
         * @var string $confirmationToken
         */
        protected $confirmationToken;
     
        /**
         * @var datetime $passwordRequestedAt
         */
        protected $passwordRequestedAt;
     
        /**
         * @var array $roles
         */
        protected $roles;
     
        /**
         * @var boolean $credentialsExpired
         */
        protected $credentialsExpired;
     
        /**
         * @var datetime $credentialsExpireAt
         */
        protected $credentialsExpireAt;
     
     
        /**
         * Get id
         *
         * @return integer 
         */
        public function getId()
        {
            return $this->id;
        }
     
        /**
         * Set name
         *
         * @param string $name
         */
        public function setName($name)
        {
            $this->name = $name;
        }
     
        /**
         * Get name
         *
         * @return string 
         */
        public function getName()
        {
            return $this->name;
        }
     
        /**
         * Set surname
         *
         * @param string $surname
         */
        public function setSurname($surname)
        {
            $this->surname = $surname;
        }
     
        /**
         * Get surname
         *
         * @return string 
         */
        public function getSurname()
        {
            return $this->surname;
        }
     
        /**
         * Set dateBirth
         *
         * @param date $dateBirth
         */
        public function setDateBirth($dateBirth)
        {
            $this->dateBirth = $dateBirth;
        }
     
        /**
         * Get dateBirth
         *
         * @return date 
         */
        public function getDateBirth()
        {
            return $this->dateBirth;
        }
     
        /**
         * Set phone
         *
         * @param string $phone
         */
        public function setPhone($phone)
        {
            $this->phone = $phone;
        }
     
        /**
         * Get phone
         *
         * @return string 
         */
        public function getPhone()
        {
            return $this->phone;
        }
     
        /**
         * Set civility
         *
         * @param Civility $civility
         */
        public function setCivility(Civility $civility)
        {
            $this->civility = $civility;
        }
     
        /**
         * Get civility
         *
         * @return Civility 
         */
        public function getCivility()
        {
            return $this->civility;
        }
     
        /**
         * Set nationnality
         *
         * @param Nationnality $nationnality
         */
        public function setNationnality(Nationnality $nationnality)
        {
            $this->nationnality = $nationnality;
        }
     
        /**
         * Get nationnality
         *
         * @return Nationnality 
         */
        public function getNationnality()
        {
            return $this->nationnality;
        }
     
        /**
         * Set email
         *
         * @param string $email
         */
        public function setEmail($email)
        {
            $this->email = $email;
        }
     
        /**
         * Get email
         *
         * @return string 
         */
        public function getEmail()
        {
            return $this->email;
        }
     
        /**
         * Set school
         *
         * @param School $school
         */
        public function setSchool(School $school)
        {
            $this->school = $school;
        }
     
        /**
         * Get school
         *
         * @return School 
         */
        public function getSchool()
        {
            return $this->school;
        }
     
        /**
         * Set language
         *
         * @param Language $language
         */
        public function setLanguage(Language $language)
        {
            $this->language = $language;
        }
     
        /**
         * Get language
         *
         * @return Language 
         */
        public function getLanguage()
        {
            return $this->language;
        }
     
        /**
         * Set description
         *
         * @param string $description
         */
        public function setDescription($description)
        {
            $this->description = $description;
        }
     
        /**
         * Get description
         *
         * @return string 
         */
        public function getDescription()
        {
            return $this->description;
        }
     
        /**
         * Set interest
         *
         * @param Interest $interest
         */
        public function setInterest(Interest $interest)
        {
            $this->interest = $interest;
        }
     
        /**
         * Get Interest
         *
         * @return integer 
         */
        public function getInterest()
        {
            return $this->interest;
        }
     
        /**
         * Set lodgement
         *
         * @param Lodgement $lodgement
         */
        public function setLodgement(Lodgement $lodgement)
        {
            $this->lodgement = $lodgement;
        }
     
        /**
         * Get lodgement
         *
         * @return Lodgement 
         */
        public function getLodgement()
        {
            return $this->lodgement;
        }
     
        /**
         * Set photo
         *
         * @param Photo $photo
         */
        public function setPhoto(Photo $photo)
        {
            $this->photo = $photo;
        }
     
        /**
         * Get photo
         *
         * @return Photo 
         */
        public function getPhoto()
        {
            return $this->photo;
        }
     
        /**
         * Set adress
         *
         * @param Adress $adress
         */
        public function setAdress(Adress $adress)
        {
            $this->adress = $adress;
        }
     
        /**
         * Get adress
         *
         * @return Adress 
         */
        public function getAdress()
        {
            return $this->adress;
        }
     
        /**
         * Set usernameCanonical
         *
         * @param string $usernameCanonical
         */
        public function setUsernameCanonical($usernameCanonical)
        {
            $this->usernameCanonical = $usernameCanonical;
        }
     
        /**
         * Get usernameCanonical
         *
         * @return string 
         */
        public function getUsernameCanonical()
        {
            return $this->usernameCanonical;
        }
     
        /**
         * Set password
         *
         * @param string $password
         */
        public function setPassword($password)
        {
            $this->password = $password;
        }
     
        /**
         * Get password
         *
         * @return string 
         */
        public function getPassword()
        {
            return $this->password;
        }
     
        /**
         * Set username
         *
         * @param string $username
         */
        public function setUsername($username)
        {
            $this->username = $username;
        }
     
        /**
         * Get username
         *
         * @return string 
         */
        public function getUsername()
        {
            return $this->username;
        }
     
        /**
         * Set emailCanonical
         *
         * @param string $emailCanonical
         */
        public function setEmailCanonical($emailCanonical)
        {
            $this->emailCanonical = $emailCanonical;
        }
     
        /**
         * Get emailCanonical
         *
         * @return string 
         */
        public function getEmailCanonical()
        {
            return $this->emailCanonical;
        }
     
        /**
         * Set enabled
         *
         * @param boolean $enabled
         */
        public function setEnabled($enabled)
        {
            $this->enabled = $enabled;
        }
     
        /**
         * Get enabled
         *
         * @return boolean 
         */
        public function getEnabled()
        {
            return $this->enabled;
        }
     
        /**
         * Set salt
         *
         * @param string $salt
         */
        public function setSalt($salt)
        {
            $this->salt = $salt;
        }
     
        /**
         * Get salt
         *
         * @return string 
         */
        public function getSalt()
        {
            return $this->salt;
        }
     
        /**
         * Set lastLogin
         *
         * @param datetime $lastLogin
         */
        public function setLastLogin($lastLogin)
        {
            $this->lastLogin = $lastLogin;
        }
     
        /**
         * Get lastLogin
         *
         * @return datetime 
         */
        public function getLastLogin()
        {
            return $this->lastLogin;
        }
     
        /**
         * Set locked
         *
         * @param boolean $locked
         */
        public function setLocked($locked)
        {
            $this->locked = $locked;
        }
     
        /**
         * Get locked
         *
         * @return boolean 
         */
        public function getLocked()
        {
            return $this->locked;
        }
     
        /**
         * Set expired
         *
         * @param boolean $expired
         */
        public function setExpired($expired)
        {
            $this->expired = $expired;
        }
     
        /**
         * Get expired
         *
         * @return boolean 
         */
        public function getExpired()
        {
            return $this->expired;
        }
     
        /**
         * Set expiresAt
         *
         * @param datetime $expiresAt
         */
        public function setExpiresAt($expiresAt)
        {
            $this->expiresAt = $expiresAt;
        }
     
        /**
         * Get expiresAt
         *
         * @return datetime 
         */
        public function getExpiresAt()
        {
            return $this->expiresAt;
        }
     
        /**
         * Set confirmationToken
         *
         * @param string $confirmationToken
         */
        public function setConfirmationToken($confirmationToken)
        {
            $this->confirmationToken = $confirmationToken;
        }
     
        /**
         * Get confirmationToken
         *
         * @return string 
         */
        public function getConfirmationToken()
        {
            return $this->confirmationToken;
        }
     
        /**
         * Set passwordRequestedAt
         *
         * @param datetime $passwordRequestedAt
         */
        public function setPasswordRequestedAt($passwordRequestedAt)
        {
            $this->passwordRequestedAt = $passwordRequestedAt;
        }
     
        /**
         * Get passwordRequestedAt
         *
         * @return datetime 
         */
        public function getPasswordRequestedAt()
        {
            return $this->passwordRequestedAt;
        }
     
        /**
         * Set roles
         *
         * @param array $roles
         */
        public function setRoles($roles)
        {
            $this->roles = $roles;
        }
     
        /**
         * Get roles
         *
         * @return array 
         */
        public function getRoles()
        {
            return $this->roles;
        }
     
        /**
         * Set credentialsExpired
         *
         * @param boolean $credentialsExpired
         */
        public function setCredentialsExpired($credentialsExpired)
        {
            $this->credentialsExpired = $credentialsExpired;
        }
     
        /**
         * Get credentialsExpired
         *
         * @return boolean 
         */
        public function getCredentialsExpired()
        {
            return $this->credentialsExpired;
        }
     
        /**
         * Set credentialsExpireAt
         *
         * @param datetime $credentialsExpireAt
         */
        public function setCredentialsExpireAt($credentialsExpireAt)
        {
            $this->credentialsExpireAt = $credentialsExpireAt;
        }
     
        /**
         * Get credentialsExpireAt
         *
         * @return datetime 
         */
        public function getCredentialsExpireAt()
        {
            return $this->credentialsExpireAt;
        }
    }
    Merci

  2. #2
    Membre habitué
    Profil pro
    Développeur Web
    Inscrit en
    Avril 2010
    Messages
    141
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Avril 2010
    Messages : 141
    Points : 157
    Points
    157
    Par défaut
    Pourquoi redéfinis-tu des propriétés déjà présentes dans FOSUser?

    Tu redéfinis donc la propriété lastLogin ainsi que ses accesseurs, mais ta redéfinition de celle-ci n'est pas exacte. Voici celle de la classe FOSUser :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    public function setLastLogin(\DateTime $time)
        {
            $this->lastLogin = $time;
     
            return $this;
        }
    Ta redéfinition ne possède pas de retour. Je ne sais pas si l’absence de typage en DateTime est gênant. Mais dans tous les cas, redéfinir cette propriété et toutes celles existant déjà dans FOSUser est inutile.

  3. #3
    Membre du Club
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 96
    Points : 48
    Points
    48
    Par défaut
    Citation Envoyé par KzrData Voir le message

    Ta redéfinition ne possède pas de retour. Je ne sais pas si l’absence de typage en DateTime est gênant. Mais dans tous les cas, redéfinir cette propriété et toutes celles existant déjà dans FOSUser est inutile.
    Merci de ta réponse

    Je vais essayer ça de suite, mais ceci est du code autogénérer s'est pour ça que je ne me suis pas plus pencher dessus. J'essaye ça !

  4. #4
    Membre du Club
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 96
    Points : 48
    Points
    48
    Par défaut
    En fait, je dois supprimer toutes les redéfinitions qui on été faites de manière automatique pour chacun des paramètres de FOSUserBundle ? Donc surname, lastLogin etc. S'est bien ça ?

  5. #5
    Membre habitué Avatar de Avrel
    Homme Profil pro
    Développeur Web
    Inscrit en
    Avril 2010
    Messages
    118
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Avril 2010
    Messages : 118
    Points : 177
    Points
    177
    Par défaut
    Oui c'est ça tu laisses juste ce que tu a ajouté toi, le reste tu le vires

  6. #6
    Membre du Club
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 96
    Points : 48
    Points
    48
    Par défaut
    Citation Envoyé par Avrel Voir le message
    Oui c'est ça tu laisses juste ce que tu a ajouté toi, le reste tu le vires
    Je l'ai fait, ça a l'air de mieux fonctionné. J'ai même supprimer se qui se rapporté a l'email, néanmoins, j'ai l'erreur suivante :

    MappingException: Duplicate definition of column 'email' on entity 'mySite\UserBundle\Entity\User' in a field or discriminator column mapping.

  7. #7
    Membre habitué
    Profil pro
    Développeur Web
    Inscrit en
    Avril 2010
    Messages
    141
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Avril 2010
    Messages : 141
    Points : 157
    Points
    157
    Par défaut
    Tu dois supprimer la propriété et ses accesseurs. Et un petit cache:clear, et update de la base. Cela devrait passer normalement

  8. #8
    Membre du Club
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 96
    Points : 48
    Points
    48
    Par défaut
    Citation Envoyé par KzrData Voir le message
    Tu dois supprimer la propriété et ses accesseurs. Et un petit cache:clear, et update de la base. Cela devrait passer normalement
    J'ai bien supprimer les accesseurs etc... mais je ne peux pas faire de cache:clear a cause de l'erreur du dessus : Duplicate definition of column "email" on entity user...
    Pourtant j'ai bien tout supprimer

    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
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    <?php
     
    namespace mySite\UserBundle\Entity;
     
    use Doctrine\ORM\Mapping as ORM;
    use FOS\UserBundle\Entity\User as BaseUser;
     
    /**
     * mySite\UserBundle\Entity\User
     */
    class User extends BaseUser
    {
        /**
         * @var integer $id
         */
        protected $id;
     
        /**
         * @var string $name
         */
        private $name;
     
        /**
         * @var string $surname
         */
        private $surname;
     
        /**
         * @var date $dateBirth
         */
        private $dateBirth;
     
        /**
         * @var string $phone
         */
        private $phone;
     
        /**
         * @var integer $civility
         */
        private $civility;
     
        /**
         * @var integer $nationnality
         */
        private $nationnality;
     
        /**
         * @var integer $school
         */
        private $school;
     
        /**
         * @var integer $language
         */
        private $language;
     
        /**
         * @var string $description
         */
        private $description;
     
        /**
         * @var integer $interest
         */
        private $interest;
     
        /**
         * @var integer $lodgement
         */
        private $lodgement;
     
        /**
         * @var integer $photo
         */
        private $photo;
     
        /**
         * @var integer $adress
         */
        private $adress;
     
     
        /**
         * Get id
         *
         * @return integer 
         */
        public function getId()
        {
            return $this->id;
        }
     
        /**
         * Set name
         *
         * @param string $name
         */
        public function setName($name)
        {
            $this->name = $name;
        }
     
        /**
         * Get name
         *
         * @return string 
         */
        public function getName()
        {
            return $this->name;
        }
     
        /**
         * Set surname
         *
         * @param string $surname
         */
        public function setSurname($surname)
        {
            $this->surname = $surname;
        }
     
        /**
         * Get surname
         *
         * @return string 
         */
        public function getSurname()
        {
            return $this->surname;
        }
     
        /**
         * Set dateBirth
         *
         * @param date $dateBirth
         */
        public function setDateBirth($dateBirth)
        {
            $this->dateBirth = $dateBirth;
        }
     
        /**
         * Get dateBirth
         *
         * @return date 
         */
        public function getDateBirth()
        {
            return $this->dateBirth;
        }
     
        /**
         * Set phone
         *
         * @param string $phone
         */
        public function setPhone($phone)
        {
            $this->phone = $phone;
        }
     
        /**
         * Get phone
         *
         * @return string 
         */
        public function getPhone()
        {
            return $this->phone;
        }
     
        /**
         * Set civility
         *
         * @param Civility $civility
         */
        public function setCivility(Civility $civility)
        {
            $this->civility = $civility;
        }
     
        /**
         * Get civility
         *
         * @return Civility 
         */
        public function getCivility()
        {
            return $this->civility;
        }
     
        /**
         * Set nationnality
         *
         * @param Nationnality $nationnality
         */
        public function setNationnality(Nationnality $nationnality)
        {
            $this->nationnality = $nationnality;
        }
     
        /**
         * Get nationnality
         *
         * @return Nationnality 
         */
        public function getNationnality()
        {
            return $this->nationnality;
        }
     
        /**
         * Set school
         *
         * @param School $school
         */
        public function setSchool(School $school)
        {
            $this->school = $school;
        }
     
        /**
         * Get school
         *
         * @return School 
         */
        public function getSchool()
        {
            return $this->school;
        }
     
        /**
         * Set language
         *
         * @param Language $language
         */
        public function setLanguage(Language $language)
        {
            $this->language = $language;
        }
     
        /**
         * Get language
         *
         * @return Language 
         */
        public function getLanguage()
        {
            return $this->language;
        }
     
        /**
         * Set description
         *
         * @param string $description
         */
        public function setDescription($description)
        {
            $this->description = $description;
        }
     
        /**
         * Get description
         *
         * @return string 
         */
        public function getDescription()
        {
            return $this->description;
        }
     
        /**
         * Set interest
         *
         * @param Interest $interest
         */
        public function setInterest(Interest $interest)
        {
            $this->interest = $interest;
        }
     
        /**
         * Get Interest
         *
         * @return integer 
         */
        public function getInterest()
        {
            return $this->interest;
        }
     
        /**
         * Set lodgement
         *
         * @param Lodgement $lodgement
         */
        public function setLodgement(Lodgement $lodgement)
        {
            $this->lodgement = $lodgement;
        }
     
        /**
         * Get lodgement
         *
         * @return Lodgement 
         */
        public function getLodgement()
        {
            return $this->lodgement;
        }
     
        /**
         * Set photo
         *
         * @param Photo $photo
         */
        public function setPhoto(Photo $photo)
        {
            $this->photo = $photo;
        }
     
        /**
         * Get photo
         *
         * @return Photo 
         */
        public function getPhoto()
        {
            return $this->photo;
        }
     
        /**
         * Set adress
         *
         * @param Adress $adress
         */
        public function setAdress(Adress $adress)
        {
            $this->adress = $adress;
        }
     
        /**
         * Get adress
         *
         * @return Adress 
         */
        public function getAdress()
        {
            return $this->adress;
        }
     
    }

  9. #9
    Membre habitué
    Profil pro
    Développeur Web
    Inscrit en
    Avril 2010
    Messages
    141
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Avril 2010
    Messages : 141
    Points : 157
    Points
    157
    Par défaut
    Cela devrait pourtant fonctionner.

    Tu n'as pas modifié le FOSUserBundle?
    Quel est le message d'erreur exact?

  10. #10
    Membre du Club
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 96
    Points : 48
    Points
    48
    Par défaut
    Citation Envoyé par KzrData Voir le message
    Cela devrait pourtant fonctionner.

    Tu n'as pas modifié le FOSUserBundle?
    Quel est le message d'erreur exact?
    Voilà le message d'erreur que j'ai ! (en pièce jointe
    Images attachées Images attachées  

  11. #11
    Membre du Club
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 96
    Points : 48
    Points
    48
    Par défaut
    Citation Envoyé par KzrData Voir le message
    Cela devrait pourtant fonctionner.

    Tu n'as pas modifié le FOSUserBundle?
    Quel est le message d'erreur exact?
    Et non je n'ai pas modifier le bundle FOS

  12. #12
    Membre habitué
    Profil pro
    Développeur Web
    Inscrit en
    Avril 2010
    Messages
    141
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Avril 2010
    Messages : 141
    Points : 157
    Points
    157
    Par défaut
    Alors là...
    S'il n'est plus fait mention d'email dans ton User... Je ne vois pas d'où pourrait venir le problème. Tu n'as pas pu updater la base précédemment normalement?

    As-tu un fichier User avec un tilde présent dans ton dossier Entity? Dans ce cas-là, supprime-le.

  13. #13
    Membre du Club
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    96
    Détails du profil
    Informations personnelles :
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 96
    Points : 48
    Points
    48
    Par défaut
    Citation Envoyé par KzrData Voir le message
    Alors là...
    S'il n'est plus fait mention d'email dans ton User... Je ne vois pas d'où pourrait venir le problème. Tu n'as pas pu updater la base précédemment normalement?

    As-tu un fichier User avec un tilde présent dans ton dossier Entity? Dans ce cas-là, supprime-le.
    Bon, j'ai supprimer mes entités, j'ai tout refait a partir de la base, j'ai laissé tel quel ma classe user avec les méthodes de UserBundle de FOS, et ça repart...
    Mais toujours pas compris pourquoi ça ne fonctionnait pas !

    M'enfin on s'en moque maintenant

    Merci à vous, je vais avoir besoin de vous parce que je débute complètement avec Symfony 2 ^^

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [XL-2007] Problème avec mon user-form
    Par serenite dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 03/11/2013, 18h40
  2. [2.x] FOS User Bundle
    Par Malum dans le forum Symfony
    Réponses: 0
    Dernier message: 13/02/2012, 21h17
  3. Migration 2000 vers 2008 : Problème avec les Users
    Par BenoitM dans le forum Réplications
    Réponses: 1
    Dernier message: 07/12/2009, 14h13
  4. problème avec bean user
    Par moumen dans le forum Struts 1
    Réponses: 1
    Dernier message: 17/05/2007, 11h16
  5. [INSTALL][DB2] problème avec les users
    Par fabszn dans le forum DB2
    Réponses: 1
    Dernier message: 03/08/2006, 20h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo