Sam Janssens
Sam Janssens

Reputation: 1491

use "Class" as entity name in symfony2.1

I have an entity which should logically be called a "Class" (as in a class in school)

But when using

class Class {

in my code, it obviously throws an error.

because I realize this is a reserved keyword, hence the "obvious"

Is there any way around this besides giving the entity a different name?

Upvotes: 0

Views: 71

Answers (1)

Damien
Damien

Reputation: 5882

You cannot use "class" as class name, this is a reserved word.

http://php.net/manual/en/reserved.keywords.php

Upvotes: 4

Related Questions