G
G
gachkydxvbgd2017-05-03 13:44:31
symfony
gachkydxvbgd, 2017-05-03 13:44:31

How to make entity without id symfony?

/**
 * @ORM\Entity
 * @ORM\Table(name="settings")
 */
class SettingsEntity
{

    /**
     * @Assert\NotBlank()
     * @ORM\Column(name="key", type="string", length=255)
     */
    public $key;

    /**
     * @Assert\NotBlank()
     * @ORM\Column(name="value", type="text")
     */
    public $value;

}

No identifier/primary key specified for Entity "AdminBundle\Entity\SettingsEntity". Every Entity must have an identifier/primary key.

24682f15616e4fcb8c36edf960155668.png
How to make key as primary key in entity?
Key will not change, values ​​will only change in value

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Komarov, 2017-05-03
@gachkydxvbgd

RTFM . The phrase "Every entity class must have an identifier/primary key" seems to hint.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question