[solved] change class name

0 votes
asked Jul 25, 2014 in Solved by kukoman (340 points)
recategorized Jul 25, 2014 by Martin Freki Stradej

when i generate entity - lets say i have table core_user and i want my class name and a file name be the same
when i double click on the entity i can change in export-file-name which than doesnt corresponds to the class name
so where do i change this?

name: CoreUser.php and it should be possible to change the core_user class name to: "class CoreUser {...} "
in attributes i can override only class attribute but not class name itself :/

1 Answer

+1 vote
answered Jul 25, 2014 by Martin Freki Stradej Skipper developer (74,840 points)
selected Jul 25, 2014 by kukoman
 
Best answer

Name of the entity used in the visual model is a class name, and by default it is also used as a file name.

Export-file-name serves to override this default setting (name of the entity is used when this attribute is empty).

You can edit both name (class name) and export-file-name in the property editor:

enter image description here

commented Jul 25, 2014 by kukoman (340 points)

i want leave the table name and override class name and the file name...

what you are proposing will change table name

// User.php
/**
* @ORM\Entity(repositoryClass="User")
* @ORM\Table(name="core_user")
*/
class User {...}

commented Jul 25, 2014 by Martin Freki Stradej Skipper developer (74,840 points)

What is edited in the Skipper is ORM Schema, therefore in the visual model you see and edit entities(classes). Table name is defined by an ORM attribute 'Table':

enter image description here

...