| 439 | | >If your task needs access to the database layer, it should extend `sfPropelBaseTask` instead of `sfBaseTask`. The task initialization will then take care of loading the additional Propel classes. The task can require an `application` and an `env` argument so that you can start a database connection in the `execute()` method by calling: |
|---|
| 440 | | > |
|---|
| 441 | | > $configuration = ProjectConfiguration::getApplicationConfiguration($arguments['application'], $options['env'], true); |
|---|
| 442 | | > $databaseManager = new sfDatabaseManager($configuration); |
|---|
| 443 | | > |
|---|
| 444 | | >By default, skeletons generated by a call to `task:init` include this initialization. |
|---|
| | 439 | >If your task needs access to the database layer, it should extend `sfPropelBaseTask` instead of `sfBaseTask`. The task initialization will then take care of loading the additional Propel classes. You can start a database connection in the `execute()` method by calling: |
|---|
| | 440 | > |
|---|
| | 441 | > $databaseManager = new sfDatabaseManager($this->configuration); |
|---|
| | 442 | > |
|---|
| | 443 | >If the task configuration defines an `application` and an `env` argument, they are automatically considered when building the task configuration, so that a task can use any of the database connections defined in your `databases.yml`. By default, skeletons generated by a call to `generate:task` include this initialization. |
|---|