Automatically delete the old model files that Doctrine generated

Posted: August 20th, 2009 | Author: Marc | Filed under: easier | Tags: , , , | 4 Comments »

I just released another plugin for symfony 1.2! The plugin is named uvmcDoctrineTaskExtraPlugin and aims to provide some tasks to help you with Doctrine.

The task I created today is really simple but helps a lot when it comes to manage the files that doctrine created. I’m pretty sure you already had to delete all the models, forms, filters and table that doctrine generated because of a typo in your model’s name or because it suxxed. Well, now, thanks to this plugin, you’ll be able to do that in a second.

You simply have to run:

php symfony doctrine:delete-files-of-model myModelName

and it will automagically deletes every files related to this model.


Solr search engine within Symfony

Posted: August 12th, 2009 | Author: Marc | Filed under: powerful | Tags: , , , , | 4 Comments »

Today I released my first plugin (yay!) for the symfony framework. It’s called uvmcSolrSearchPlugin and it permits you to integrate your solr search service within symfony, giving you the power of a real search engine in your website.

Read the rest of this entry »


Doctrine throws an Exception “Couldn’t get last insert identifier.”

Posted: July 10th, 2009 | Author: Marc | Filed under: easier | Tags: , , , | 2 Comments »

If Doctrine throw “Couldn’t get last insert identifier.” exception to your face, you might want to check the schema.yml of your table and change all your:

type: int

to

type: integer

Here is an exemple:
THIS IS BAD:

1
2
3
4
5
6
7
8
MyModel:
  actAs:
    Timestampable:     ~
  columns:
    id:
      type:             int(4)
      primary:          true
      autoincrement:    true

THIS IS GOOD:

1
2
3
4
5
6
7
8
MyModel:
  actAs:
    Timestampable:     ~
  columns:
    id:
      type:             integer(4)
      primary:          true
      autoincrement:    true

This might solve your problem.


UTF-8 on all your tables with Doctrine 1.1 and Symfony 1.2

Posted: July 8th, 2009 | Author: Marc | Filed under: easier | Tags: , , , | 5 Comments »

Maybe you already had the problem to deal with multiple collations in your database. You want to have utf8 by default but you’re too lazy to fix ALL your schema.yml?

Well, this solution is for you:

Just add this function in your ProjectConfiguration class in “/config/ProjectConfiguration.class.php”

1
2
3
4
5
public function configureDoctrine(Doctrine_Manager $manager)
{
  $manager->setCollate('utf8_unicode_ci');
  $manager->setCharset('utf8');
}

Next time you’ll do a:

php symfony doctrine:build-all-reload

Your tables will be encoded in UTF-8, even in the plugins! :)