Reverse engineering development with Symfony2

$ php app/console doctrine:mapping:convert xml ./src/Acme/DemoBundle/Resources/config/doctrine/metadata/orm --from-database --force

## add mapping unknown types
doctrine:
dbal:
connections:
default:
// Other connections parameters
mapping_types:
oid: string

 

## generate Entities from DB
$ php app/console doctrine:mapping:import --em=foo AcmeDemoBundle annotation
## generate get//set method in Entity File
$ php app/console doctrine:generate:entities AcmeDemoBundle

 

Advertisements

Doctrine sluggable

You can add next to BaseObject of Doctrine Model.

    public function setUp()
    {
        parent::setUp();
		$sluggable0 = new Doctrine_Template_Sluggable(array(
             'unique' => true,
             'fields' => 
        	     array(
            		0 => 'name',
             	 ),
             'canUpdate' => true,
             ));
        $this->actAs($sluggable0);                
    }

If
Name : about us
Then
Slug : about-us