symfony/symfony — Issue #3409: Exception thrown in console when indexes specified in yml config for entity with no table name
Author: neilferreira
Created: 2012-02-22 07:34:21+00:00
State: open

Hey all,

My apologies if this is a dupe, or should be going into a doctrine issue tracker instead.

When an entity has been setup using a YML config (have not checked other methods of setup) and the table name has been left as null to be automatically setup you cannot add indexes to that table without running into issues.

Example:
```php
Client\SiteBundle\Entity\EntryReport:
type: entity
table: null
indexes:
index_name_index:
columns: testCol
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
testCol:
type: integer
lifecycleCallbacks: { }
```

Running './app/console generate:doctrine:entities ClientSiteBiundle:EntryReport' throws the following exception:
[ErrorException]
Notice: Undefined index: name in ./vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php line 1266

Line 1266 is calling:
```php
public function getTableName()
{
return $this->table['name'];
```