Symphony2 :expects a(n) integer, but got string
Résolu
eleveing
Messages postés
73
Date d'inscription
Statut
Membre
Dernière intervention
-
Fredty -
Fredty -
Bonjour tout le monde,
je suis en train de developper avec symphony et quand j 'execute la commande:
php app/console doctrine:generate:entities MyApp
j obtiens
C:\wamp\www\sym>php app/console doctrine:generate:entities MyApp
Generating entities for namespace "MyApp"
[Doctrine\Common\Annotations\AnnotationException]
[Type Error] Attribute "length" of @ORM\Column declared on property MyApp\F
ilmothequeBundle\Entity\employe::$nom expects a(n) integer, but got string.
doctrine:generate:entities [--path="..."] [--no-backup] name
C:\wamp\www\sym>
ma classe:
<?php
namespace MyApp\FilmothequeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
*/
class employe
{
/**
* @ORM\GeneratedValue
* @ORM\Id
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string",length="255")
* @Assert\NotBlank()
* @Assert\MinLength(3)
*/
private $nom;
}
j ai remplacé length="255" par length=255
j'obtiens:
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "@Symfony\Component\Validator\Constraints
\MinLength" in property MyApp\FilmothequeBundle\Entity\employe::$nom does n
ot exist, or could not be auto-loaded.
doctrine:generate:entities [--path="..."] [--no-backup] name
Merci d'avance,
je suis en train de developper avec symphony et quand j 'execute la commande:
php app/console doctrine:generate:entities MyApp
j obtiens
C:\wamp\www\sym>php app/console doctrine:generate:entities MyApp
Generating entities for namespace "MyApp"
[Doctrine\Common\Annotations\AnnotationException]
[Type Error] Attribute "length" of @ORM\Column declared on property MyApp\F
ilmothequeBundle\Entity\employe::$nom expects a(n) integer, but got string.
doctrine:generate:entities [--path="..."] [--no-backup] name
C:\wamp\www\sym>
ma classe:
<?php
namespace MyApp\FilmothequeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
*/
class employe
{
/**
* @ORM\GeneratedValue
* @ORM\Id
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string",length="255")
* @Assert\NotBlank()
* @Assert\MinLength(3)
*/
private $nom;
}
j ai remplacé length="255" par length=255
j'obtiens:
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "@Symfony\Component\Validator\Constraints
\MinLength" in property MyApp\FilmothequeBundle\Entity\employe::$nom does n
ot exist, or could not be auto-loaded.
doctrine:generate:entities [--path="..."] [--no-backup] name
Merci d'avance,
2 réponses
Je kiffe toujours les gens qui se prétendent développeurs avec des framework, mais qui ne savent pas faire une simple recherche ...
https://openclassrooms.com/forum/sujet/erreur-symfony
https://openclassrooms.com/forum/sujet/erreur-symfony