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 type datetime comme identifiant


Sujet :

Symfony PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Candidat au Club
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Décembre 2012
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Madagascar

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux
    Secteur : Service public

    Informations forums :
    Inscription : Décembre 2012
    Messages : 2
    Par défaut problème avec type datetime comme identifiant
    Bonjour,

    J'ai un petit souci avec doctrine, parait-il que doctrine n'arrive pas à gérer les identifiant de type date et renvoi un erreur de genre "Catchable Fatal Error: Object of class DateTime could not be converted to string in....UnitOfWork.php line 1337".

    En résumé j'ai besoin d'utilisé deux champs comme identifiant dans mon entité; le premier est de type integer (sans problème) et le second de type date (celui qui pose un problème)

    Est-ce que quelqu'un peut me venir en aide ?

    Merci

  2. #2
    Membre Expert
    Homme Profil pro
    Inscrit en
    Septembre 2009
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Septembre 2009
    Messages : 875
    Par défaut
    Avec mon experience symfony2, je trouve qu'il est plus utile point de vue développement (et non point de vue conception) d’utiliser toujours un ID numérique et de lier tes deux champs par une clef unique.
    Ainsi tu gardes ta contrainte de conception, et tu manipule tes objets facilement.

    Je pense que tu as oublié d'implémenter ceci de la solution proposée:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    class MyDateTime extends \DateTime 
    {
        public function __toString()
        {
            return $this->format('U');
        }
    }
    Attention je crois que l'équipe de modération ici n'aime pas les références sur des sites externes concurrentiel. en espérant que tu trouves solution :]

  3. #3
    Candidat au Club
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Décembre 2012
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Madagascar

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux
    Secteur : Service public

    Informations forums :
    Inscription : Décembre 2012
    Messages : 2
    Par défaut
    @gototog: merci pour ta réponse et ton avertissement,
    En faite je débute avec le POO en générale et PHP avec Symfony2 en particulier.

    Est-ce que tu peux me décrire pas à pas ce que je devrait faire et ou implémenter la fonction __toString(). Autrement dit : je copie colle ou les 2 codes ?

    Ta proposition je l'ai déjà essayé, mais je n'arrive pas à imposer le nouveau id comme un numéro automatique et garder les deux champs comme clé primaire.

    voici mon entités :
    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
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    <?php
    namespace Sentinelle\SentBundle\Entity;
    use Doctrine\ORM\Mapping as ORM;
    use Symfony\Component\Validator\Constraints as Assert;
    /**
    * @ORM\Entity
    */
    class Donnees
    {
    	/**
         * @ORM\Column(type="date")
    	 * @Assert\NotBlank()
    	 * @ORM\Id	 
    	 */    
    	private $dater;
    	/**
         * @ORM\Column(type="string",length=3)
    	 * @Assert\NotBlank()
    	 * @ORM\Id
    	 */
    	private $centre;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $nxconslt1;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $nxconslt1_4;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
     
    	private $nxconslt5_14;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
     
    	private $nxconslt15_24;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $nxconslt25_49;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $nxconslt50p;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $nxconsltTotal;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $syndf;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $palususp;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $testpalu;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $paluconf;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $arbosusp;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $grippsusp;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $autrvirresp;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $diarrh;
        /**
         * @ORM\Column(type="integer")
    	 * @Assert\NotBlank()
         */	 
    	private $diarrhfeb;
        /**
         * @ORM\Column(type="integer")
    	 */	 
    	private $ind_f;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $ind_pal;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $ind_test;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $ind_palconf;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $ind_arbo;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $ind_grip;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $ind_autvresp;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $ind_diarr;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $ind_diarrfeb1;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $ind_diarrfeb2;
        /**
         * @ORM\Column(type="datetime")
         * @Assert\NotBlank()
         */	 
    	private $dateenvoi;
        /**
         * @ORM\Column(type="string")
         */	 
    	private $message;
        /**
         * @ORM\Column(type="string")
         */	 
    	private $envoi;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $stck_act;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $stck_sp;
        /**
         * @ORM\Column(type="integer")
         */	 
    	private $stck_quinine;
     
        /**
         * Set dater
         *
         * @param string $dater
         * @return Donnees
         */
        public function setDater($dater)
        {
            $this->dater = $dater;
     
            return $this;
        }
     
        /**
         * Get dater
         *
         * @return string 
         */
        public function getDater()
        {
            return $this->dater;
        }
     
        /**
         * Set centre
         *
         * @param string $centre
         * @return Donnees
         */
        public function setCentre($centre)
        {
            $this->centre = $centre;
     
            return $this;
        }
     
        /**
         * Get centre
         *
         * @return string 
         */
        public function getCentre()
        {
            return $this->centre;
        }
     
        /**
         * Set nxconslt1
         *
         * @param integer $nxconslt1
         * @return Donnees
         */
        public function setNxconslt1($nxconslt1)
        {
            $this->nxconslt1 = $nxconslt1;
     
            return $this;
        }
     
        /**
         * Get nxconslt1
         *
         * @return integer 
         */
        public function getNxconslt1()
        {
            return $this->nxconslt1;
        }
     
        /**
         * Set nxconslt1_4
         *
         * @param integer $nxconslt14
         * @return Donnees
         */
        public function setNxconslt14($nxconslt14)
        {
            $this->nxconslt1_4 = $nxconslt14;
     
            return $this;
        }
     
        /**
         * Get nxconslt1_4
         *
         * @return integer 
         */
        public function getNxconslt14()
        {
            return $this->nxconslt1_4;
        }
     
        /**
         * Set nxconslt5_14
         *
         * @param integer $nxconslt514
         * @return Donnees
         */
        public function setNxconslt514($nxconslt514)
        {
            $this->nxconslt5_14 = $nxconslt514;
     
            return $this;
        }
     
        /**
         * Get nxconslt5_14
         *
         * @return integer 
         */
        public function getNxconslt514()
        {
            return $this->nxconslt5_14;
        }
     
        /**
         * Set nxconslt15_24
         *
         * @param integer $nxconslt1524
         * @return Donnees
         */
        public function setNxconslt1524($nxconslt1524)
        {
            $this->nxconslt15_24 = $nxconslt1524;
     
            return $this;
        }
     
        /**
         * Get nxconslt15_24
         *
         * @return integer 
         */
        public function getNxconslt1524()
        {
            return $this->nxconslt15_24;
        }
     
        /**
         * Set nxconslt25_49
         *
         * @param integer $nxconslt2549
         * @return Donnees
         */
        public function setNxconslt2549($nxconslt2549)
        {
            $this->nxconslt25_49 = $nxconslt2549;
     
            return $this;
        }
     
        /**
         * Get nxconslt25_49
         *
         * @return integer 
         */
        public function getNxconslt2549()
        {
            return $this->nxconslt25_49;
        }
     
        /**
         * Set nxconslt50p
         *
         * @param integer $nxconslt50p
         * @return Donnees
         */
        public function setNxconslt50p($nxconslt50p)
        {
            $this->nxconslt50p = $nxconslt50p;
     
            return $this;
        }
     
        /**
         * Get nxconslt50p
         *
         * @return integer 
         */
        public function getNxconslt50p()
        {
            return $this->nxconslt50p;
        }
     
        /**
         * Set nxconsltTotal
         *
         * @param integer $nxconsltTotal
         * @return Donnees
         */
        public function setNxconsltTotal($nxconsltTotal)
        {
            $this->nxconsltTotal = $nxconsltTotal;
     
            return $this;
        }
     
        /**
         * Get nxconsltTotal
         *
         * @return integer 
         */
        public function getNxconsltTotal()
        {
            return $this->nxconsltTotal;
        }
     
        /**
         * Set syndf
         *
         * @param integer $syndf
         * @return Donnees
         */
        public function setSyndf($syndf)
        {
            $this->syndf = $syndf;
     
            return $this;
        }
     
        /**
         * Get syndf
         *
         * @return integer 
         */
        public function getSyndf()
        {
            return $this->syndf;
        }
     
        /**
         * Set palususp
         *
         * @param integer $palususp
         * @return Donnees
         */
        public function setPalususp($palususp)
        {
            $this->palususp = $palususp;
     
            return $this;
        }
     
        /**
         * Get palususp
         *
         * @return integer 
         */
        public function getPalususp()
        {
            return $this->palususp;
        }
     
        /**
         * Set testpalu
         *
         * @param integer $testpalu
         * @return Donnees
         */
        public function setTestpalu($testpalu)
        {
            $this->testpalu = $testpalu;
     
            return $this;
        }
     
        /**
         * Get testpalu
         *
         * @return integer 
         */
        public function getTestpalu()
        {
            return $this->testpalu;
        }
     
        /**
         * Set paluconf
         *
         * @param integer $paluconf
         * @return Donnees
         */
        public function setPaluconf($paluconf)
        {
            $this->paluconf = $paluconf;
     
            return $this;
        }
     
        /**
         * Get paluconf
         *
         * @return integer 
         */
        public function getPaluconf()
        {
            return $this->paluconf;
        }
     
        /**
         * Set arbosusp
         *
         * @param integer $arbosusp
         * @return Donnees
         */
        public function setArbosusp($arbosusp)
        {
            $this->arbosusp = $arbosusp;
     
            return $this;
        }
     
        /**
         * Get arbosusp
         *
         * @return integer 
         */
        public function getArbosusp()
        {
            return $this->arbosusp;
        }
     
        /**
         * Set grippsusp
         *
         * @param integer $grippsusp
         * @return Donnees
         */
        public function setGrippsusp($grippsusp)
        {
            $this->grippsusp = $grippsusp;
     
            return $this;
        }
     
        /**
         * Get grippsusp
         *
         * @return integer 
         */
        public function getGrippsusp()
        {
            return $this->grippsusp;
        }
     
        /**
         * Set autrvirresp
         *
         * @param integer $autrvirresp
         * @return Donnees
         */
        public function setAutrvirresp($autrvirresp)
        {
            $this->autrvirresp = $autrvirresp;
     
            return $this;
        }
     
        /**
         * Get autrvirresp
         *
         * @return integer 
         */
        public function getAutrvirresp()
        {
            return $this->autrvirresp;
        }
     
        /**
         * Set diarrh
         *
         * @param integer $diarrh
         * @return Donnees
         */
        public function setDiarrh($diarrh)
        {
            $this->diarrh = $diarrh;
     
            return $this;
        }
     
        /**
         * Get diarrh
         *
         * @return integer 
         */
        public function getDiarrh()
        {
            return $this->diarrh;
        }
     
        /**
         * Set diarrhfeb
         *
         * @param integer $diarrhfeb
         * @return Donnees
         */
        public function setDiarrhfeb($diarrhfeb)
        {
            $this->diarrhfeb = $diarrhfeb;
     
            return $this;
        }
     
        /**
         * Get diarrhfeb
         *
         * @return integer 
         */
        public function getDiarrhfeb()
        {
            return $this->diarrhfeb;
        }
     
        /**
         * Set ind_f
         *
         * @param integer $indF
         * @return Donnees
         */
        public function setIndF($indF)
        {
            $this->ind_f = $indF;
     
            return $this;
        }
     
        /**
         * Get ind_f
         *
         * @return integer 
         */
        public function getIndF()
        {
            return $this->ind_f;
        }
     
        /**
         * Set ind_pal
         *
         * @param integer $indPal
         * @return Donnees
         */
        public function setIndPal($indPal)
        {
            $this->ind_pal = $indPal;
     
            return $this;
        }
     
        /**
         * Get ind_pal
         *
         * @return integer 
         */
        public function getIndPal()
        {
            return $this->ind_pal;
        }
     
        /**
         * Set ind_test
         *
         * @param integer $indTest
         * @return Donnees
         */
        public function setIndTest($indTest)
        {
            $this->ind_test = $indTest;
     
            return $this;
        }
     
        /**
         * Get ind_test
         *
         * @return integer 
         */
        public function getIndTest()
        {
            return $this->ind_test;
        }
     
        /**
         * Set ind_palconf
         *
         * @param integer $indPalconf
         * @return Donnees
         */
        public function setIndPalconf($indPalconf)
        {
            $this->ind_palconf = $indPalconf;
     
            return $this;
        }
     
        /**
         * Get ind_palconf
         *
         * @return integer 
         */
        public function getIndPalconf()
        {
            return $this->ind_palconf;
        }
     
        /**
         * Set ind_arbo
         *
         * @param integer $indArbo
         * @return Donnees
         */
        public function setIndArbo($indArbo)
        {
            $this->ind_arbo = $indArbo;
     
            return $this;
        }
     
        /**
         * Get ind_arbo
         *
         * @return integer 
         */
        public function getIndArbo()
        {
            return $this->ind_arbo;
        }
     
        /**
         * Set ind_grip
         *
         * @param integer $indGrip
         * @return Donnees
         */
        public function setIndGrip($indGrip)
        {
            $this->ind_grip = $indGrip;
     
            return $this;
        }
     
        /**
         * Get ind_grip
         *
         * @return integer 
         */
        public function getIndGrip()
        {
            return $this->ind_grip;
        }
     
        /**
         * Set ind_autvresp
         *
         * @param integer $indAutvresp
         * @return Donnees
         */
        public function setIndAutvresp($indAutvresp)
        {
            $this->ind_autvresp = $indAutvresp;
     
            return $this;
        }
     
        /**
         * Get ind_autvresp
         *
         * @return integer 
         */
        public function getIndAutvresp()
        {
            return $this->ind_autvresp;
        }
     
        /**
         * Set ind_diarr
         *
         * @param integer $indDiarr
         * @return Donnees
         */
        public function setIndDiarr($indDiarr)
        {
            $this->ind_diarr = $indDiarr;
     
            return $this;
        }
     
        /**
         * Get ind_diarr
         *
         * @return integer 
         */
        public function getIndDiarr()
        {
            return $this->ind_diarr;
        }
     
        /**
         * Set ind_diarrfeb1
         *
         * @param integer $indDiarrfeb1
         * @return Donnees
         */
        public function setIndDiarrfeb1($indDiarrfeb1)
        {
            $this->ind_diarrfeb1 = $indDiarrfeb1;
     
            return $this;
        }
     
        /**
         * Get ind_diarrfeb1
         *
         * @return integer 
         */
        public function getIndDiarrfeb1()
        {
            return $this->ind_diarrfeb1;
        }
     
        /**
         * Set ind_diarrfeb2
         *
         * @param integer $indDiarrfeb2
         * @return Donnees
         */
        public function setIndDiarrfeb2($indDiarrfeb2)
        {
            $this->ind_diarrfeb2 = $indDiarrfeb2;
     
            return $this;
        }
     
        /**
         * Get ind_diarrfeb2
         *
         * @return integer 
         */
        public function getIndDiarrfeb2()
        {
            return $this->ind_diarrfeb2;
        }
     
        /**
         * Set dateenvoi
         *
         * @param \DateTime $dateenvoi
         * @return Donnees
         */
        public function setDateenvoi($dateenvoi)
        {
            $this->dateenvoi = $dateenvoi;
     
            return $this;
        }
     
        /**
         * Get dateenvoi
         *
         * @return \DateTime 
         */
        public function getDateenvoi()
        {
            return $this->dateenvoi;
        }
     
        /**
         * Set message
         *
         * @param string $message
         * @return Donnees
         */
        public function setMessage($message)
        {
            $this->message = $message;
     
            return $this;
        }
     
        /**
         * Get message
         *
         * @return string 
         */
        public function getMessage()
        {
            return $this->message;
        }
     
        /**
         * Set envoi
         *
         * @param string $envoi
         * @return Donnees
         */
        public function setEnvoi($envoi)
        {
            $this->envoi = $envoi;
     
            return $this;
        }
     
        /**
         * Get envoi
         *
         * @return string 
         */
        public function getEnvoi()
        {
            return $this->envoi;
        }
     
        /**
         * Set stck_act
         *
         * @param integer $stckAct
         * @return Donnees
         */
        public function setStckAct($stckAct)
        {
            $this->stck_act = $stckAct;
     
            return $this;
        }
     
        /**
         * Get stck_act
         *
         * @return integer 
         */
        public function getStckAct()
        {
            return $this->stck_act;
        }
     
        /**
         * Set stck_sp
         *
         * @param integer $stckSp
         * @return Donnees
         */
        public function setStckSp($stckSp)
        {
            $this->stck_sp = $stckSp;
     
            return $this;
        }
     
        /**
         * Get stck_sp
         *
         * @return integer 
         */
        public function getStckSp()
        {
            return $this->stck_sp;
        }
     
        /**
         * Set stck_quinine
         *
         * @param integer $stckQuinine
         * @return Donnees
         */
        public function setStckQuinine($stckQuinine)
        {
            $this->stck_quinine = $stckQuinine;
     
            return $this;
        }
     
        /**
         * Get stck_quinine
         *
         * @return integer 
         */
        public function getStckQuinine()
        {
            return $this->stck_quinine;
        }
    }
    et le formulaire

    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
    <?php
    namespace Sentinelle\SentBundle\Form;
    use Symfony\Component\Form\AbstractType;
    use Symfony\Component\Form\FormBuilderInterface;
    class DonneesForm extends AbstractType
    {
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
    $builder
    ->add('centre','choice',array('choices'=>array('MJR'=>'ANTANANARIVO','AHH'=>'ANTSOHIHY','AJB'=>'ANJOZOROBE','BEL'=>'BELO TSIRIBIHINA','BHK'=>'ANTANANARIVO','BOE'=>'AMBATO BOENY','BOS'=>'AMBOSITRA','CDA'=>'ANTANANARIVO','FAR'=>'FARAFANGANA','FNS'=>'FIANARANTSOA I','IHO'=>'IHOSY','MAE'=>'MAEVATANANA','MDV'=>'MORONDAVA','MNJ'=>'MANANJARY','MRB'=>'MOROMBE','MRG'=>'MORAMANGA','SBV'=>'SAMBAVA','STM'=>'SAINTE MARIE','TGR'=>'TAOLAGNARO','TLR'=>'TOLIARA','TOA'=>'TOAMASINA','TSL'=>'ANTANANARIVO','ABZ'=>'AMBATONDRAZAKA','DIE'=>'ANTSIRANANA','DRI'=>'MANDRITSARA','MHJ'=>'MAHAJANGA','MIA'=>'MIANDRIVAZO','EJD'=>'EJEDA','ABV'=>'AMBOVOMBE','ATB'=>'ANTSIRABE I','MRT'=>'MAROANTSETRA','MTN'=>'MAINTIRANO','NSB'=>'NOSY BE','TDD'=>'TSIROANOMANDIDY')))
    ->add('dater', 'birthday')
    ->add('nxconslt1')
    ->add('nxconslt1_4')
    ->add('nxconslt5_14')
    ->add('nxconslt15_24')
    ->add('nxconslt25_49')
    ->add('nxconslt50p')
    ->add('nxconsltTotal')
    ->add('syndf')
    ->add('palususp')
    ->add('testpalu')
    ->add('paluconf')
    ->add('arbosusp')
    ->add('grippsusp')
    ->add('autrvirresp')
    ->add('diarrh')
    ->add('diarrhfeb')
    ->add('ind_f')
    ->add('ind_pal')
    ->add('ind_test')
    ->add('ind_palconf')
    ->add('ind_arbo')
    ->add('ind_grip')
    ->add('ind_autvresp')
    ->add('ind_diarr')
    ->add('ind_diarrfeb1')
    ->add('ind_diarrfeb2')
    ->add('dateenvoi','birthday')
    ->add('message')
    ->add('envoi')
    ->add('stck_act')
    ->add('stck_sp')
    ->add('stck_quinine')
    ;
    }
    public function getName()
    {
    return 'donnees';
    }
    }
    Merci encore

Discussions similaires

  1. Problème avec type enum
    Par oranoutan dans le forum Débuter
    Réponses: 4
    Dernier message: 19/05/2007, 13h47
  2. Problème avec type et tableau
    Par semaj_james dans le forum Ada
    Réponses: 2
    Dernier message: 21/02/2007, 15h31
  3. [TSaveDialog] Problèmes avec type de fichier
    Par Pedro dans le forum Delphi
    Réponses: 14
    Dernier message: 14/12/2006, 21h53
  4. Problème avec type de données
    Par yancimer dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 21/09/2006, 16h54
  5. [debutant] problème avec type à utiliser
    Par mlequim dans le forum Autres SGBD
    Réponses: 2
    Dernier message: 15/07/2005, 16h08

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