{"action":"reopened","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/17671","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/17671/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/17671/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/17671/events","html_url":"https://github.com/symfony/symfony/issues/17671","id":131117508,"number":17671,"title":"Varchar in Formbuilder Symfony","user":{"login":"eses89","id":17051710,"avatar_url":"https://avatars.githubusercontent.com/u/17051710?v=3","gravatar_id":"","url":"https://api.github.com/users/eses89","html_url":"https://github.com/eses89","followers_url":"https://api.github.com/users/eses89/followers","following_url":"https://api.github.com/users/eses89/following{/other_user}","gists_url":"https://api.github.com/users/eses89/gists{/gist_id}","starred_url":"https://api.github.com/users/eses89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eses89/subscriptions","organizations_url":"https://api.github.com/users/eses89/orgs","repos_url":"https://api.github.com/users/eses89/repos","events_url":"https://api.github.com/users/eses89/events{/privacy}","received_events_url":"https://api.github.com/users/eses89/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-03T18:48:31Z","updated_at":"2016-02-03T18:49:25Z","closed_at":null,"body":"Hello together,\r\n\r\nI have enitiy class  user:\r\n`<?php\r\n\r\n class User {\r\n\r\n  /**\r\n  * @var integer\r\n  *\r\n  * @ORM\\Column(name=\"id\", type=\"integer\")\r\n  * @ORM\\Id\r\n  * @ORM\\GeneratedValue(strategy=\"AUTO\")\r\n  */\r\n private $id;\r\n\r\n/**\r\n* @var string\r\n* @ORM\\Column(type=\"string\", nullable=false)\r\n*/\r\nprivate $firstName;\r\n\r\n/**\r\n* @var string\r\n* @ORM\\Column(type=\"string\", nullable=false)\r\n*/\r\nprivate $lasttName;\r\n  /**\r\n  * @ORM\\ManyToOne(targetEntity=\"\\Test\\TravelBundle\\Entity\\Flight\",     inversedBy=\"flight\")\r\n  * @ORM\\JoinColumn(name=\"flight\", referencedColumnName=\"flightnumber\",        nullable=true)\r\n  * @var \\Test\\TravelBundle\\Entity\\Flight\r\n  **/\r\n   private $flight;\r\n\r\n.......\r\n/**\r\n * Set flight\r\n *\r\n * @param \\Test\\TravelBundle\\Entity\\Flight $flight\r\n * @return User\r\n */\r\npublic function setFlight(\\Test\\TravelBundle\\Entity\\Flight $flight = null)\r\n{\r\n    $this->flight = $flight;\r\n    return $this;\r\n}\r\n/**\r\n * Get flight\r\n *\r\n * @return \\Test\\TravelBundle\\Entity\\Flight\r\n */\r\npublic function getId()\r\n{\r\n    return $this->flight;\r\n}`\r\n\r\n class User {\r\n\r\n  /**\r\n  * @var integer\r\n  *\r\n  * @ORM\\Column(name=\"id\", type=\"integer\")\r\n  * @ORM\\Id\r\n  * @ORM\\GeneratedValue(strategy=\"AUTO\")\r\n  */\r\n private $id;\r\n\r\n/**\r\n* @var string\r\n* @ORM\\Column(type=\"string\", nullable=false)\r\n*/\r\nprivate $firstName;\r\n\r\n/**\r\n* @var string\r\n* @ORM\\Column(type=\"string\", nullable=false)\r\n*/\r\nprivate $lasttName;\r\n  /**\r\n  * @ORM\\ManyToOne(targetEntity=\"\\Test\\TravelBundle\\Entity\\Flight\",     inversedBy=\"flight\")\r\n  * @ORM\\JoinColumn(name=\"flight\", referencedColumnName=\"flightnumber\",        nullable=true)\r\n  * @var \\Test\\TravelBundle\\Entity\\Flight\r\n  **/\r\n   private $flight;\r\n\r\n.......\r\n/**\r\n * Set flight\r\n *\r\n * @param \\Test\\TravelBundle\\Entity\\Flight $flight\r\n * @return User\r\n */\r\npublic function setFlight(\\Test\\TravelBundle\\Entity\\Flight $flight = null)\r\n{\r\n    $this->flight = $flight;\r\n    return $this;\r\n}\r\n/**\r\n * Get flight\r\n *\r\n * @return \\Test\\TravelBundle\\Entity\\Flight\r\n */\r\npublic function getId()\r\n{\r\n    return $this->flight;\r\n}`\r\n\r\nAnd the formbuilder for that is:`public function newUser()\r\n{\r\n\r\n\r\n            // ID\r\n            ->add('id', 'text', array(\r\n                'label' => 'form.labels.id',\r\n                'translation_domain' => 'User'))\r\n\r\n            // Firstname\r\n            ->add('firstname', 'text', array(\r\n                'label' => 'form.labels.firstname',\r\n                'translation_domain' => 'User'))\r\n\r\n          // lastName\r\n            ->add('lastname', 'text', array(\r\n                'label' => 'form.labels.lastname',\r\n                'translation_domain' => 'User'))\r\n\r\n            // Flight number\r\n            ->add('flightNumber', 'integer', array(\r\n                'label' => 'form.labels.flightNumber',\r\n                'translation_domain' => 'User'))\r\n\r\n\r\n                ))\r\n            // Submit button\r\n            ->add('save', 'submit', array(\r\n                'label' => 'form.buttons.submitUser',\r\n                'translation_domain' => 'submit'))`\r\n\r\nThe flightnumber is a column from the entity flight\r\n`class Flight {\r\n\r\n/**\r\n * @ORM\\Id\r\n * @ORM\\Column(type=\"string\", length=8, name=\"flightnumber\")\r\n */\r\nprotected $id;\r\n\r\n/**\r\n *\r\n * @var string @ORM\\Column(type=\"string\", length=32)\r\n */\r\nprotected $name;\r\n\r\n/**\r\n * Set id\r\n *\r\n * @param integer $id           \r\n * @return Flight\r\n */\r\npublic function setId($id) {\r\n    $this->id = $id;\r\n\r\n    return $this;\r\n}\r\n\r\n/**\r\n * Get id\r\n *\r\n * @return integer\r\n */\r\npublic function getId() {\r\n    return $this->id;\r\n}`\r\n\r\nThe problem is that the flightnumber is in the database varchar and on the formbuilder i have integer when i change to text it doesnt accept numbers, is it possible tp put the type as varchar"}}