Doctrine to Propel symfony 1.4 switch

How can I correctly switch the recently installed Symfony 1.4 infrastructure from Doctrine (it is configured by default) to Propel?

+6
propel symfony1 doctrine
source share
4 answers

If you are creating a new (fresh) project ...

symfony generate:project xxx --orm=Propel 

The simplest thing :)

If you want to modify an existing project, you need to insert the configuration file and enable the propel plugin.

Your configuration file should look like this:

 // config/ProjectConfiguration.class.php public function setup() { $this->enablePlugins('sfPropelPlugin'); ... } 

(based on the Symfony page, you should dig it up next time - especially Practical Symfony )

+8
source share

Use Propel if you like object oriented syntax.

+5
source share

If you like chaining method calls that look like SQL statements, use Doctrine. If you like real objects that hide SQL, use Propel.

If you like to create criteria objects that then display themselves as WHERE clauses, use Propel. If you like creating SQL-like WHERE clauses, use Doctrine.

You can use both at the same time. Not recommended, but if you use plugins like the apostrophe that only use Doctrine, you may not have a choice.

+5
source share

Answering those participants who fully recommend the Doctrine: in my opinion, the solution is not clear. Propel now also supports query chains, so if you like this approach, both of them are still in the game. In addition, the Propel team claims that the generated nature of the model objects makes it faster for most use cases than Doctrine.

+1
source share

All Articles