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

Doctrine2 PHP Discussion :

Génération d'entités


Sujet :

Doctrine2 PHP

  1. #1
    Membre éclairé Avatar de fahdijbeli
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Juin 2012
    Messages : 281
    Par défaut Génération d'entités
    bonjour,
    j'ai géneré mes entités avec revers engeneering mais j'ai des relations entre mes entités et j'ai pas trouvé les annotation dans mes entités (ManyToOne,...) normalment la commande va génerer les annotation regarde mes entités
    entity Customers:
    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
     
    <?php
     
    namespace test\testBundle\Entity;
     
    use Doctrine\ORM\Mapping as ORM;
     
    /**
     * test\testBundle\Entity\Customers
     *
     * @ORM\Table(name="customers")
     * @ORM\Entity
     */
    class Customers
    {
        /**
         * @var integer $idCustomer
         *
         * @ORM\Column(name="ID_CUSTOMER", type="integer", nullable=false)
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="IDENTITY")
         */
        private $idCustomer;
     
        /**
         * @var integer $idCategory
         *
         * @ORM\Column(name="ID_CATEGORY", type="integer", nullable=true)
         */
        private $idCategory;
     
        /**
         * @var string $name
         *
         * @ORM\Column(name="NAME", type="string", length=500, nullable=true)
         */
        private $name;
     
        /**
         * @var string $adress
         *
         * @ORM\Column(name="ADRESS", type="string", length=500, nullable=true)
         */
        private $adress;
     
        /**
         * @var string $tel1
         *
         * @ORM\Column(name="TEL_1", type="string", length=16, nullable=true)
         */
        private $tel1;
     
        /**
         * @var string $tel2
         *
         * @ORM\Column(name="TEL_2", type="string", length=16, nullable=true)
         */
        private $tel2;
     
        /**
         * @var string $fax
         *
         * @ORM\Column(name="FAX", type="string", length=16, nullable=true)
         */
        private $fax;
     
        /**
         * @var string $email
         *
         * @ORM\Column(name="EMAIL", type="string", length=500, nullable=true)
         */
        private $email;
     
        /**
         * @var string $matriculeFiscale
         *
         * @ORM\Column(name="MATRICULE_FISCALE", type="string", length=40, nullable=true)
         */
        private $matriculeFiscale;
     
        /**
         * @var string $registreCommerce
         *
         * @ORM\Column(name="REGISTRE_COMMERCE", type="string", length=40, nullable=true)
         */
        private $registreCommerce;
     
        /**
         * @var string $managerName
         *
         * @ORM\Column(name="MANAGER_NAME", type="string", length=500, nullable=true)
         */
        private $managerName;
     
        /**
         * @var string $managerTel
         *
         * @ORM\Column(name="MANAGER_TEL", type="string", length=16, nullable=true)
         */
        private $managerTel;
     
        /**
         * @var string $managerEmail
         *
         * @ORM\Column(name="MANAGER_EMAIL", type="string", length=500, nullable=true)
         */
        private $managerEmail;
     
        /**
         * @var string $loginProvider
         *
         * @ORM\Column(name="LOGIN_PROVIDER", type="string", length=100, nullable=true)
         */
        private $loginProvider;
     
        /**
         * @var string $passwordProvider
         *
         * @ORM\Column(name="PASSWORD_PROVIDER", type="string", length=100, nullable=true)
         */
        private $passwordProvider;
     
        /**
         * @var string $login
         *
         * @ORM\Column(name="LOGIN", type="string", length=100, nullable=true)
         */
        private $login;
     
        /**
         * @var string $password
         *
         * @ORM\Column(name="PASSWORD", type="string", length=100, nullable=true)
         */
        private $password;
     
        /**
         * @var string $ipAutorized
         *
         * @ORM\Column(name="IP_AUTORIZED", type="string", length=20, nullable=true)
         */
        private $ipAutorized;
     
        /**
         * @var datetime $dateCreation
         *
         * @ORM\Column(name="DATE_CREATION", type="datetime", nullable=false)
         */
        private $dateCreation;
     
     
     
        /**
         * Get idCustomer
         *
         * @return integer 
         */
        public function getIdCustomer()
        {
            return $this->idCustomer;
        }
     
        /**
         * Set idCategory
         *
         * @param integer $idCategory
         */
        public function setIdCategory($idCategory)
        {
            $this->idCategory = $idCategory;
        }
     
        /**
         * Get idCategory
         *
         * @return integer 
         */
        public function getIdCategory()
        {
            return $this->idCategory;
        }
     
        /**
         * Set name
         *
         * @param string $name
         */
        public function setName($name)
        {
            $this->name = $name;
        }
     
        /**
         * Get name
         *
         * @return string 
         */
        public function getName()
        {
            return $this->name;
        }
     
        /**
         * Set adress
         *
         * @param string $adress
         */
        public function setAdress($adress)
        {
            $this->adress = $adress;
        }
     
        /**
         * Get adress
         *
         * @return string 
         */
        public function getAdress()
        {
            return $this->adress;
        }
     
        /**
         * Set tel1
         *
         * @param string $tel1
         */
        public function setTel1($tel1)
        {
            $this->tel1 = $tel1;
        }
     
        /**
         * Get tel1
         *
         * @return string 
         */
        public function getTel1()
        {
            return $this->tel1;
        }
     
        /**
         * Set tel2
         *
         * @param string $tel2
         */
        public function setTel2($tel2)
        {
            $this->tel2 = $tel2;
        }
     
        /**
         * Get tel2
         *
         * @return string 
         */
        public function getTel2()
        {
            return $this->tel2;
        }
     
        /**
         * Set fax
         *
         * @param string $fax
         */
        public function setFax($fax)
        {
            $this->fax = $fax;
        }
     
        /**
         * Get fax
         *
         * @return string 
         */
        public function getFax()
        {
            return $this->fax;
        }
     
        /**
         * Set email
         *
         * @param string $email
         */
        public function setEmail($email)
        {
            $this->email = $email;
        }
     
        /**
         * Get email
         *
         * @return string 
         */
        public function getEmail()
        {
            return $this->email;
        }
     
        /**
         * Set matriculeFiscale
         *
         * @param string $matriculeFiscale
         */
        public function setMatriculeFiscale($matriculeFiscale)
        {
            $this->matriculeFiscale = $matriculeFiscale;
        }
     
        /**
         * Get matriculeFiscale
         *
         * @return string 
         */
        public function getMatriculeFiscale()
        {
            return $this->matriculeFiscale;
        }
     
        /**
         * Set registreCommerce
         *
         * @param string $registreCommerce
         */
        public function setRegistreCommerce($registreCommerce)
        {
            $this->registreCommerce = $registreCommerce;
        }
     
        /**
         * Get registreCommerce
         *
         * @return string 
         */
        public function getRegistreCommerce()
        {
            return $this->registreCommerce;
        }
     
        /**
         * Set managerName
         *
         * @param string $managerName
         */
        public function setManagerName($managerName)
        {
            $this->managerName = $managerName;
        }
     
        /**
         * Get managerName
         *
         * @return string 
         */
        public function getManagerName()
        {
            return $this->managerName;
        }
     
        /**
         * Set managerTel
         *
         * @param string $managerTel
         */
        public function setManagerTel($managerTel)
        {
            $this->managerTel = $managerTel;
        }
     
        /**
         * Get managerTel
         *
         * @return string 
         */
        public function getManagerTel()
        {
            return $this->managerTel;
        }
     
        /**
         * Set managerEmail
         *
         * @param string $managerEmail
         */
        public function setManagerEmail($managerEmail)
        {
            $this->managerEmail = $managerEmail;
        }
     
        /**
         * Get managerEmail
         *
         * @return string 
         */
        public function getManagerEmail()
        {
            return $this->managerEmail;
        }
     
        /**
         * Set loginProvider
         *
         * @param string $loginProvider
         */
        public function setLoginProvider($loginProvider)
        {
            $this->loginProvider = $loginProvider;
        }
     
        /**
         * Get loginProvider
         *
         * @return string 
         */
        public function getLoginProvider()
        {
            return $this->loginProvider;
        }
     
        /**
         * Set passwordProvider
         *
         * @param string $passwordProvider
         */
        public function setPasswordProvider($passwordProvider)
        {
            $this->passwordProvider = $passwordProvider;
        }
     
        /**
         * Get passwordProvider
         *
         * @return string 
         */
        public function getPasswordProvider()
        {
            return $this->passwordProvider;
        }
     
        /**
         * Set login
         *
         * @param string $login
         */
        public function setLogin($login)
        {
            $this->login = $login;
        }
     
        /**
         * Get login
         *
         * @return string 
         */
        public function getLogin()
        {
            return $this->login;
        }
     
        /**
         * Set password
         *
         * @param string $password
         */
        public function setPassword($password)
        {
            $this->password = $password;
        }
     
        /**
         * Get password
         *
         * @return string 
         */
        public function getPassword()
        {
            return $this->password;
        }
     
        /**
         * Set ipAutorized
         *
         * @param string $ipAutorized
         */
        public function setIpAutorized($ipAutorized)
        {
            $this->ipAutorized = $ipAutorized;
        }
     
        /**
         * Get ipAutorized
         *
         * @return string 
         */
        public function getIpAutorized()
        {
            return $this->ipAutorized;
        }
     
        /**
         * Set dateCreation
         *
         * @param datetime $dateCreation
         */
        public function setDateCreation($dateCreation)
        {
            $this->dateCreation = $dateCreation;
        }
     
        /**
         * Get dateCreation
         *
         * @return datetime 
         */
        public function getDateCreation()
        {
            return $this->dateCreation;
        }
    }
    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
     
    <?php
     
    namespace test\testBundle\Entity;
     
    use Doctrine\ORM\Mapping as ORM;
     
    /**
     * test\testBundle\Entity\CustomerCredit
     *
     * @ORM\Table(name="customer_credit")
     * @ORM\Entity
     */
    class CustomerCredit
    {
        /**
         * @var integer $customerCreditId
         *
         * @ORM\Column(name="CUSTOMER_CREDIT_ID", type="integer", nullable=false)
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="IDENTITY")
         */
        private $customerCreditId;
     
        /**
         * @var integer $idCustomer
         *
         * @ORM\Column(name="ID_CUSTOMER", type="integer", nullable=true)
         */
        private $idCustomer;//doit étre en relation avec Customers
     
        /**
         * @var decimal $amount
         *
         * @ORM\Column(name="AMOUNT", type="decimal", nullable=true)
         */
        private $amount;
     
        /**
         * @var datetime $dateCredit
         *
         * @ORM\Column(name="DATE_CREDIT", type="datetime", nullable=false)
         */
        private $dateCredit;
     
     
     
        /**
         * Get customerCreditId
         *
         * @return integer 
         */
        public function getCustomerCreditId()
        {
            return $this->customerCreditId;
        }
     
        /**
         * Set idCustomer
         *
         * @param integer $idCustomer
         */
        public function setIdCustomer($idCustomer)
        {
            $this->idCustomer = $idCustomer;
        }
     
        /**
         * Get idCustomer
         *
         * @return integer 
         */
        public function getIdCustomer()
        {
            return $this->idCustomer;
        }
     
        /**
         * Set amount
         *
         * @param decimal $amount
         */
        public function setAmount($amount)
        {
            $this->amount = $amount;
        }
     
        /**
         * Get amount
         *
         * @return decimal 
         */
        public function getAmount()
        {
            return $this->amount;
        }
     
        /**
         * Set dateCredit
         *
         * @param datetime $dateCredit
         */
        public function setDateCredit($dateCredit)
        {
            $this->dateCredit = $dateCredit;
        }
     
        /**
         * Get dateCredit
         *
         * @return datetime 
         */
        public function getDateCredit()
        {
            return $this->dateCredit;
        }
    }
    je peux manipuler à la main mais je sais pas pourqoi n'est pas géneré automatiquement soit j'ai une base de 15 tables est ce que je vais manipuler à la main sa cout long temps et meerci d'avance.

  2. #2
    Expert confirmé

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Par défaut
    Citation Envoyé par fahdiraed Voir le message
    je vais manipuler à la main sa cout long temps et meerci d'avance.
    le temps d'attendre une réponse t'aurai déjà finis ...
    tes tables sont en InnoDB ?

  3. #3
    Membre éclairé Avatar de fahdijbeli
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Juin 2012
    Messages : 281
    Par défaut
    bonjour,
    j'ai des tables InnoDB est des tables MyIsam estce que je peux génerer avec myIsam

  4. #4
    Membre éclairé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Avril 2012
    Messages
    394
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2012
    Messages : 394
    Par défaut
    As tu définie les relation entre les tables dans ton SGBDD (MySQL) avant de générer ces entités ?

  5. #5
    Membre éclairé Avatar de fahdijbeli
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Juin 2012
    Messages : 281
    Par défaut
    oui ,
    voici mes requétes sql
    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
     
     
     
    CREATE TABLE IF NOT EXISTS `categories` (
      `ID_CATEGORIE` int(10) NOT NULL auto_increment,
      `LIBELLE` varchar(500) default NULL,
      PRIMARY KEY  (`ID_CATEGORIE`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4;
     
     
    CREATE TABLE IF NOT EXISTS `customers` (
      `ID_CUSTOMER` int(10) NOT NULL auto_increment,
      `ID_CATEGORY` int(10) default NULL,
      `NAME` varchar(500) default NULL,
      `ADRESS` varchar(500) default NULL,
      `TEL_1` varchar(16) default NULL,
      `TEL_2` varchar(16) default NULL,
      `FAX` varchar(16) default NULL,
      `EMAIL` varchar(500) default NULL,
      `MATRICULE_FISCALE` varchar(40) default NULL,
      `REGISTRE_COMMERCE` varchar(40) default NULL,
      `MANAGER_NAME` varchar(500) default NULL,
      `MANAGER_TEL` varchar(16) default NULL,
      `MANAGER_EMAIL` varchar(500) default NULL,
      `LOGIN_PROVIDER` varchar(100) default NULL,
      `PASSWORD_PROVIDER` varchar(100) default NULL,
      `LOGIN` varchar(100) default NULL,
      `PASSWORD` varchar(100) default NULL,
      `IP_AUTORIZED` varchar(20) default NULL,
      `DATE_CREATION` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
      PRIMARY KEY  (`ID_CUSTOMER`),
      KEY `FK_CATEGORY_TO_CUSTOMER` (`ID_CATEGORY`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
     
     
    CREATE TABLE IF NOT EXISTS `customer_credit` (
      `CUSTOMER_CREDIT_ID` int(10) NOT NULL,
      `ID_CUSTOMER` int(10) default NULL,
      `AMOUNT` decimal(8,6) default NULL,
      `DATE_CREDIT` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
      PRIMARY KEY  (`CUSTOMER_CREDIT_ID`),
      KEY `FK_CUSTOMER_TO_CREDIT` (`ID_CUSTOMER`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
     
     
    CREATE TABLE IF NOT EXISTS `customer_credit` (
      `CUSTOMER_CREDIT_ID` int(10) NOT NULL,
      `ID_CUSTOMER` int(10) default NULL,
      `AMOUNT` decimal(8,6) default NULL,
      `DATE_CREDIT` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
      PRIMARY KEY  (`CUSTOMER_CREDIT_ID`),
      KEY `FK_CUSTOMER_TO_CREDIT` (`ID_CUSTOMER`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
     
    -- --------------------------------------------------------
     
    --
    -- Structure de la table `customer_rates_exep`
    --
     
    CREATE TABLE IF NOT EXISTS `customer_rates_exep` (
      `RATES_EXP_ID` int(10) NOT NULL auto_increment,
      `ID_CUSTOMER` int(10) NOT NULL,
      `DESTINATION_ID` int(10) default NULL,
      `TAUX` decimal(8,6) default NULL,
      `DATE_DEBUT` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
      PRIMARY KEY  (`RATES_EXP_ID`),
      KEY `FK_CUSTOMER_TO_RATES_EXEP` (`ID_CUSTOMER`),
      KEY `FK_DEST_RATE_TO_RATES_EXEP` (`DESTINATION_ID`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ;
     
     
    CREATE TABLE IF NOT EXISTS `customer_refill` (
      `CUST_REFILL_ID` int(10) NOT NULL,
      `ID_CUSTOMER` int(10) default NULL,
      `REFILL_AMOUNT` decimal(12,6) default NULL,
      `REFILL_DATE` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
      `REFILL_AMOUNT_PROVIDER` decimal(12,6) default NULL,
      `TAUX_CHANGE` decimal(8,6) default NULL,
      `STATUS` int(11) NOT NULL,
      PRIMARY KEY  (`CUST_REFILL_ID`),
      KEY `FK_CUSTOMER_TO_REFILL` (`ID_CUSTOMER`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
     
     
    CREATE TABLE IF NOT EXISTS `destination_rates` (
      `DESTINATION_ID` int(10) NOT NULL auto_increment,
      `LIBELLE` varchar(500) default NULL,
      `PRIX` decimal(8,6) default NULL,
      `TAUX` decimal(8,6) default NULL,
      `TAUX_CUST` decimal(8,6) NOT NULL,
      PRIMARY KEY  (`DESTINATION_ID`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=743 ;
     
     
    CREATE TABLE IF NOT EXISTS `rates` (
      `PREFIX` int(10) NOT NULL,
      `DESTINATION` varchar(500) default NULL,
      `PRIX` decimal(8,6) default NULL,
      `TAUX` decimal(8,6) default NULL,
      PRIMARY KEY  (`PREFIX`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    CREATE TABLE IF NOT EXISTS `call_summary` (
      `id` int(11) NOT NULL auto_increment,
      `debit` double default NULL,
      `count` int(11) default NULL,
      `destination` varchar(300) default NULL,
      `duration` int(11) default NULL,
      `durationAnswered` int(11) default NULL,
      `type` int(11) default NULL,
      `t_day` int(11) default NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=281 ;
     
     
    CREATE TABLE IF NOT EXISTS `cdr` (
      `callid` int(11) default NULL,
      `number` varchar(200) default NULL,
      `number_country_code` int(11) default NULL,
      `number_type` varchar(200) default NULL,
      `cli_pres` varchar(200) default NULL,
      `cli_number` varchar(200) default NULL,
      `cli_name` varchar(200) default NULL,
      `start` varchar(200) default NULL,
      `answer` varchar(200) default NULL,
      `hangup` varchar(200) default NULL,
      `hangupsource` varchar(200) default NULL,
      `hangupcause` varchar(200) default NULL,
      `dialstatus` varchar(200) default NULL,
      `duration` varchar(200) default NULL,
      `duration_answered` varchar(200) default NULL,
      `duration_billed` varchar(200) default NULL,
      `billing_customer_cost_label` varchar(200) default NULL,
      `billing_customer_credit_eur` varchar(200) default NULL,
      `scenario_name` varchar(200) default NULL,
      `scenario_hash` varchar(200) default NULL,
      `package_name` varchar(200) default NULL,
      `gateway_codec` varchar(200) default NULL,
      `customer_field` varchar(200) default NULL,
      `billing_customer_debit_eur` varchar(200) default NULL,
      `id` int(11) NOT NULL auto_increment,
      PRIMARY KEY  (`id`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5597 ;
     
     
    CREATE TABLE IF NOT EXISTS `customer_signup` (
      `ID_CUSTOMER_SIGNUP` int(10) NOT NULL auto_increment,
      `NAME` varchar(500) default NULL,
      `LASTNAME` varchar(500) default NULL,
      `ADRESS` varchar(500) default NULL,
      `TEL` varchar(16) default NULL,
      `EMAIL` varchar(500) default NULL,
      `NOMBRE_POSITION` decimal(10,0) default NULL,
      `DATE_CREATION` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
      `VOLUME_APPEL` varchar(500) default NULL,
      PRIMARY KEY  (`ID_CUSTOMER_SIGNUP`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=32 ;

  6. #6
    Membre éclairé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Avril 2012
    Messages
    394
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2012
    Messages : 394
    Par défaut
    Je vois ! c'est bizarre!
    Peux tu nous montrer les fichiers YAML dans TonBundle/Resources/config/doctrine/metadata/orm/ des tables concernées, fichiers générés par la commande :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
      php app/console doctrine:mapping:convert ...

  7. #7
    Membre éclairé Avatar de fahdijbeli
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Juin 2012
    Messages : 281
    Par défaut
    voici mes fichiers yml:
    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
     
    CallSummary:
      type: entity
      table: call_summary
      fields:
        id:
          id: true
          type: integer
          unsigned: false
          nullable: false
          generator:
            strategy: IDENTITY
        debit:
          type: float
          nullable: true
        count:
          type: integer
          unsigned: false
          nullable: true
        destination:
          type: string
          length: 300
          fixed: false
          nullable: true
        duration:
          type: integer
          unsigned: false
          nullable: true
        durationanswered:
          type: integer
          unsigned: false
          nullable: true
          column: durationAnswered
        type:
          type: integer
          unsigned: false
          nullable: true
        tDay:
          type: integer
          unsigned: false
          nullable: true
          column: t_day
      lifecycleCallbacks: {  }
    Categories:
      type: entity
      table: categories
      fields:
        idCategorie:
          id: true
          type: integer
          unsigned: false
          nullable: false
          column: ID_CATEGORIE
          generator:
            strategy: IDENTITY
        libelle:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: LIBELLE
      lifecycleCallbacks: {  }
    Cdr:
      type: entity
      table: cdr
      fields:
        id:
          id: true
          type: integer
          unsigned: false
          nullable: false
          generator:
            strategy: IDENTITY
        callid:
          type: integer
          unsigned: false
          nullable: true
        number:
          type: string
          length: 200
          fixed: false
          nullable: true
        numberCountryCode:
          type: integer
          unsigned: false
          nullable: true
          column: number_country_code
        numberType:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: number_type
        cliPres:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: cli_pres
        cliNumber:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: cli_number
        cliName:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: cli_name
        start:
          type: string
          length: 200
          fixed: false
          nullable: true
        answer:
          type: string
          length: 200
          fixed: false
          nullable: true
        hangup:
          type: string
          length: 200
          fixed: false
          nullable: true
        hangupsource:
          type: string
          length: 200
          fixed: false
          nullable: true
        hangupcause:
          type: string
          length: 200
          fixed: false
          nullable: true
        dialstatus:
          type: string
          length: 200
          fixed: false
          nullable: true
        duration:
          type: string
          length: 200
          fixed: false
          nullable: true
        durationAnswered:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: duration_answered
        durationBilled:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: duration_billed
        billingCustomerCostLabel:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: billing_customer_cost_label
        billingCustomerCreditEur:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: billing_customer_credit_eur
        scenarioName:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: scenario_name
        scenarioHash:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: scenario_hash
        packageName:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: package_name
        gatewayCodec:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: gateway_codec
        customerField:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: customer_field
        billingCustomerDebitEur:
          type: string
          length: 200
          fixed: false
          nullable: true
          column: billing_customer_debit_eur
      lifecycleCallbacks: {  }
    CustomerCredit:
      type: entity
      table: customer_credit
      fields:
        customerCreditId:
          id: true
          type: integer
          unsigned: false
          nullable: false
          column: CUSTOMER_CREDIT_ID
          generator:
            strategy: IDENTITY
        idCustomer:
          type: integer
          unsigned: false
          nullable: true
          column: ID_CUSTOMER
        amount:
          type: decimal
          nullable: true
          column: AMOUNT
        dateCredit:
          type: datetime
          nullable: false
          column: DATE_CREDIT
      lifecycleCallbacks: {  }
    CustomerRatesExep:
      type: entity
      table: customer_rates_exep
      fields:
        ratesExpId:
          id: true
          type: integer
          unsigned: false
          nullable: false
          column: RATES_EXP_ID
          generator:
            strategy: IDENTITY
        idCustomer:
          type: integer
          unsigned: false
          nullable: false
          column: ID_CUSTOMER
        destinationId:
          type: integer
          unsigned: false
          nullable: true
          column: DESTINATION_ID
        taux:
          type: decimal
          nullable: true
          column: TAUX
        dateDebut:
          type: datetime
          nullable: false
          column: DATE_DEBUT
      lifecycleCallbacks: {  }
    CustomerRefill:
      type: entity
      table: customer_refill
      fields:
        custRefillId:
          id: true
          type: integer
          unsigned: false
          nullable: false
          column: CUST_REFILL_ID
          generator:
            strategy: IDENTITY
        idCustomer:
          type: integer
          unsigned: false
          nullable: true
          column: ID_CUSTOMER
        refillAmount:
          type: decimal
          nullable: true
          column: REFILL_AMOUNT
        refillDate:
          type: datetime
          nullable: false
          column: REFILL_DATE
        refillAmountProvider:
          type: decimal
          nullable: true
          column: REFILL_AMOUNT_PROVIDER
        tauxChange:
          type: decimal
          nullable: true
          column: TAUX_CHANGE
        status:
          type: integer
          unsigned: false
          nullable: false
          column: STATUS
      lifecycleCallbacks: {  }
    CustomerSignup:
      type: entity
      table: customer_signup
      fields:
        idCustomerSignup:
          id: true
          type: integer
          unsigned: false
          nullable: false
          column: ID_CUSTOMER_SIGNUP
          generator:
            strategy: IDENTITY
        name:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: NAME
        lastname:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: LASTNAME
        adress:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: ADRESS
        tel:
          type: string
          length: 16
          fixed: false
          nullable: true
          column: TEL
        email:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: EMAIL
        nombrePosition:
          type: decimal
          nullable: true
          column: NOMBRE_POSITION
        dateCreation:
          type: datetime
          nullable: false
          column: DATE_CREATION
        volumeAppel:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: VOLUME_APPEL
      lifecycleCallbacks: {  }
    Customers:
      type: entity
      table: customers
      fields:
        idCustomer:
          id: true
          type: integer
          unsigned: false
          nullable: false
          column: ID_CUSTOMER
          generator:
            strategy: IDENTITY
        idCategory:
          type: integer
          unsigned: false
          nullable: true
          column: ID_CATEGORY
        name:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: NAME
        adress:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: ADRESS
        tel1:
          type: string
          length: 16
          fixed: false
          nullable: true
          column: TEL_1
        tel2:
          type: string
          length: 16
          fixed: false
          nullable: true
          column: TEL_2
        fax:
          type: string
          length: 16
          fixed: false
          nullable: true
          column: FAX
        email:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: EMAIL
        matriculeFiscale:
          type: string
          length: 40
          fixed: false
          nullable: true
          column: MATRICULE_FISCALE
        registreCommerce:
          type: string
          length: 40
          fixed: false
          nullable: true
          column: REGISTRE_COMMERCE
        managerName:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: MANAGER_NAME
        managerTel:
          type: string
          length: 16
          fixed: false
          nullable: true
          column: MANAGER_TEL
        managerEmail:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: MANAGER_EMAIL
        loginProvider:
          type: string
          length: 100
          fixed: false
          nullable: true
          column: LOGIN_PROVIDER
        passwordProvider:
          type: string
          length: 100
          fixed: false
          nullable: true
          column: PASSWORD_PROVIDER
        login:
          type: string
          length: 100
          fixed: false
          nullable: true
          column: LOGIN
        password:
          type: string
          length: 100
          fixed: false
          nullable: true
          column: PASSWORD
        ipAutorized:
          type: string
          length: 20
          fixed: false
          nullable: true
          column: IP_AUTORIZED
        dateCreation:
          type: datetime
          nullable: false
          column: DATE_CREATION
      lifecycleCallbacks: {  }
    DestinationRates:
      type: entity
      table: destination_rates
      fields:
        destinationId:
          id: true
          type: integer
          unsigned: false
          nullable: false
          column: DESTINATION_ID
          generator:
            strategy: IDENTITY
        libelle:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: LIBELLE
        prix:
          type: decimal
          nullable: true
          column: PRIX
        taux:
          type: decimal
          nullable: true
          column: TAUX
        tauxCust:
          type: decimal
          nullable: false
          column: TAUX_CUST
      lifecycleCallbacks: {  }
    Rates:
      type: entity
      table: rates
      fields:
        prefix:
          id: true
          type: integer
          unsigned: false
          nullable: false
          column: PREFIX
          generator:
            strategy: IDENTITY
        destination:
          type: string
          length: 500
          fixed: false
          nullable: true
          column: DESTINATION
        prix:
          type: decimal
          nullable: true
          column: PRIX
        taux:
          type: decimal
          nullable: true
          column: TAUX
      lifecycleCallbacks: {  }

  8. #8
    Membre éclairé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Avril 2012
    Messages
    394
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2012
    Messages : 394
    Par défaut
    t'as généré les entités et résultats tu n'as pas de relation entre elles (les tables d'avant). Les relations apparaissent dans ces fichiers YAML sous la forme suivante (exemple) :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    ManyToOne:
        NomChamp:
          targetEntity: Table1
          cascade: {  }
          mappedBy: null
          inversedBy: null
          joinColumns:
            nom_champ:
              referencedColumnName: id
          orphanRemoval: false
    Tu n'a qu'a revoir tes tables sur MySQL et les relations entre elles avant de passer sous Doctrine

  9. #9
    Membre éclairé Avatar de fahdijbeli
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Juin 2012
    Messages : 281
    Par défaut
    j'ai trouvé les relations entre mes tables dans mysql ragarde table categorie et table customers au dessus et je crois que l'utilisation de MyIsam n est pas accepté pour le revers engeneering . le probléme que j'ai pris mon fichier.sql de ma sociéte je peux pas le modifier

  10. #10
    Membre éclairé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Avril 2012
    Messages
    394
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2012
    Messages : 394
    Par défaut
    t'es sur que tu as des clés étrangères qui vont reliés des tables qui ont a leur tour des clés primaires. je vois des PRIMARY KEY mais pas des FOREIGN KEY :S Pour avoir des ManyToOne, OneToOne ... faut partir de ce principe voila quoi !!

  11. #11
    Membre éclairé Avatar de fahdijbeli
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Juin 2012
    Messages : 281
    Par défaut
    Ah parceque dans MyIsam on peut pas utiliser les clés étrangéres (foreignKey)
    mais on utilise Key 'Fk_Kategorie_To_Customers(Id_customer)' voir ca dans la table Customers .

  12. #12
    Expert confirmé

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Par défaut
    certaines tables sont en MyISAM ...
    et t'as aucun foreign donc c'est normale que tu récupères rien

  13. #13
    Membre éclairé Avatar de fahdijbeli
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Juin 2012
    Messages : 281
    Par défaut
    merci stealth35 et aitiahcene ,
    il faut tous les tables sont InnoDB et il faut utilisé les clé étrangéres
    mais comment je peux montrer que mon probléme est résolu dans le forum

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

Discussions similaires

  1. Génération d'entités
    Par david lefaivre dans le forum Doctrine2
    Réponses: 1
    Dernier message: 30/10/2012, 08h53
  2. [2.x] Création-génération d'entités pour formulaire
    Par Rafapouf dans le forum Symfony
    Réponses: 4
    Dernier message: 08/06/2012, 11h49
  3. Réponses: 2
    Dernier message: 22/05/2012, 10h14
  4. [2.x] génération d'entités sans Id
    Par supersayan86 dans le forum Symfony
    Réponses: 1
    Dernier message: 13/03/2012, 10h23
  5. Réponses: 3
    Dernier message: 08/11/2008, 18h28

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