J
J
j_seitaliev2015-10-27 10:14:15
symfony
j_seitaliev, 2015-10-27 10:14:15

What is the correct way to create a model in symfony named 'transaction'?

Help solve the problem. When creating through the model generator in symfony, there is a problem with the transaction reserved word. The table itself is named the same. How do I properly write the command to escape this word?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
shagguboy, 2015-10-27
@j_seitaliev

**
* @ORM\Entity
* @ORM\Table(name="product")
*/
or
AppBundle\Entity\Product:
type: entity
table: product

S
Sergey, 2015-10-27
Protko @Fesor

rename the entity and everything will be fine. It is desirable to name tables in plural (transactions). In general, it is better to avoid using reserved words in the names of tables or table fields.

D
Denis, 2015-10-27
@prototype_denis

@ORM\Table(name="`transaction`")
Quote the table name in entity annotations, not the entity itself.
Similarly in any other types of configuration.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question