Symphony2 :expects a(n) integer, but got string

Résolu/Fermé
eleveing Messages postés 73 Date d'inscription jeudi 30 août 2012 Statut Membre Dernière intervention 27 février 2014 - Modifié par eleveing le 22/09/2013 à 01:48
 Fredty - 5 nov. 2013 à 15:09
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,

2 réponses

Pourquoi chercher, tu leur réponds... :D
0
arth Messages postés 9374 Date d'inscription mardi 27 septembre 2005 Statut Contributeur Dernière intervention 16 décembre 2016 1 291
22 sept. 2013 à 08:40
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
-2