AKRAM EL HAMDAOUI
AKRAM EL HAMDAOUI

Reputation: 1838

Getting column names in a doctrine2 entity

How to get the names of all columns in a doctrine entity?

Upvotes: 27

Views: 23038

Answers (1)

Maxence
Maxence

Reputation: 13329

As described in the documentation for ClassMetadataInfo you can use the getColumnNames method:

$em->getClassMetadata('Entities\MyEntity')->getColumnNames();

Upvotes: 55

Related Questions