0

I have a already created table:

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.

 php bin/console doctrine:mapping:import "App\Entity" annotation --path=src/Entity

This entity generated creates something like this:

/**
 * @var int
 *
 * @ORM\Column(name="version", type="integer", nullable=false, options={"comment"="103"})
 */
private $version;

/**
 * @var string
 *
 * @ORM\Column(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?

1
  • 2
    It is default value that you have specified in CREATE TABLE query DEFAULT '' Commented Dec 24, 2019 at 8:39

1 Answer 1

2

This is set from the default value which you have specified in this

@ORM\Column(name="model", type="string", length=4, nullable=false, options={"default"="''","comment"="108"}}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.