I have a already created table:
JavaScript
x
CREATE TABLE `jt_version` (
`version` int(11) NOT NULL COMMENT '103',
`model` varchar(4) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '108'
From this table, I have generated an entity.
JavaScript
php bin/console doctrine:mapping:import "AppEntity" annotation --path=src/Entity
This entity generated creates something like this:
JavaScript
/**
* @var int
*
* @ORMColumn(name="version", type="integer", nullable=false, options={"comment"="103"})
*/
private $version;
/**
* @var string
*
* @ORMColumn(name="model", type="string", length=4, nullable=false, options={"default"="''","comment"="108"})
*/
private $model= '''';
My question is from where the value of model is getting set. In above case the $model
value is ''''
Is that correct or I need to make some change?
Advertisement
Answer
This is set from the default value which you have specified in this
JavaScript
@ORMColumn(name="model", type="string", length=4, nullable=false, options={"default"="''","comment"="108"}}