The symfony and Doctrine book

Capítulo 1 - Comenzando

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


About

You are currently reading "The symfony and Doctrine book" which is licensed under the GFDL license.

Master symfony

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).
trainings.sensiolabs.com

Books on symfony

Learn more about symfony with the official guides.
books.sensiolabs.com

L'audit Qualité par SensioLabs

200 points de contrôle de votre applicatif web.
audit.sensiolabs.com

Chapter Content

¿Qué es Doctrine?

Habiltar Doctrine

Tareas Disponibles

symfony training
Be trained by symfony experts
May 29: Paris (Web Development with Symfony2 - Français)
May 31: Paris (Mastering Symfony2 - Français)
Jun 06: Paris (Introduction to Symfony2 - Français)
Jun 06: Paris (Introduction to Symfony2 - English)
Jun 06: Paris (Going Further with Symfony2 - English)
and more...

Search


powered by google
You are currently browsing "The symfony and Doctrine book" in Spanish for the 1.2 version - Switch to language:
This work is licensed under a GFDL license.
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

El libro symfony y Doctrine no explica en detalle todo lo relacionado a Doctrine. Habla brevemente sobre unos pocos asuntos centrales que Symfony utiliza generalmente. El manual Doctrine es aún la mejor fuente de documentación de referencia de Doctrine. Es recomendado leer este libro para dar comienzo y entonces utilizar el manual Doctrine para referencias específicas de como usar Doctrine. Puedes encontrar la documentación principal de Doctrine aquí.

¿Qué es Doctrine?

Doctrine es un ORM PHP (mapeador objeto relacional) para PHP 5.2.3+ que se sitúa arriba de la poderosa PHP DBAL (capa de abstracción de la base de datos). Una de sus características clave es la facultad de opcionalmente escribir consultas a la base de datos en un lenguaje OO (orientado a objetos) demominado DQL inspirado en el HQL de Hibernate. Este brinda a los desarrolladores una poderosa alternativa al SQL manteniendo una máxima flexibilidad sin necesidad de duplicar código.


Habiltar Doctrine

Para comenzar a usar Doctrine debes primero habilitarlo editando tu método setup() config/ProjectConfiguration.class.php para permitir sfDoctrinePlugin y deshabilitar sfPropelPlugin.

public function setup()
{
  $this->enablePlugins(array('sfDoctrinePlugin'));
  $this->disablePlugins(array('sfPropelPlugin'));
}

Si prefieres tener habilitados todos los plugins por defecto, puedes hacer lo siguiente:

public function setup()
{
  $this->enableAllPluginsExcept(array('sfPropelPlugin', 'sfCompat10Plugin'));
}

Aunque no es recomendable, puedes usar Doctrine y Propel juntos. Simplemente habilita sfDoctrinePlugin sin deshabilitar sfPropelPlugin.

Tareas Disponibles

Debajo está la lista completa de tareas disponibles del sfDoctrinePlugin. sfDoctrinePlugin ofrece toda la functionalidad de sfPropelPlugin, y mucho más.

$ ./symfony list doctrine
Usage:
  symfony [options] task_name [arguments]

Options:
  --dry-run     -n  Do a dry run without executing actions.
  --help        -H  Display this help message.
  --quiet       -q  Do not log messages to standard output.
  --trace       -t  Turn on invoke/execute tracing, enable full backtrace.
  --version     -V  Display the program version.

Available tasks for the "doctrine" namespace:
  :build-all                   Generates Doctrine model, SQL and initializes the database (doctrine-build-all)
  :build-all-load              Generates Doctrine model, SQL, initializes database, and load data (doctrine-build-all-load)
  :build-all-reload            Generates Doctrine model, SQL, initializes database, and load data (doctrine-build-all-reload)
  :build-all-reload-test-all   Generates Doctrine model, SQL, initializes database, load data and run all test suites (doctrine-build-all-reload-test-all)
  :build-db                    Creates database for current model (doctrine-build-db)
  :build-filters               Creates filter form classes for the current model
  :build-forms                 Creates form classes for the current model (doctrine-build-forms)
  :build-model                 Creates classes for the current model (doctrine-build-model)
  :build-schema                Creates a schema from an existing database (doctrine-build-schema)
  :build-sql                   Creates SQL for the current model (doctrine-build-sql)
  :data-dump                   Dumps data to the fixtures directory (doctrine-dump-data)
  :data-load                   Loads data from fixtures directory (doctrine-load-data)
  :dql                         Execute a DQL query and view the results (doctrine-dql)
  :drop-db                     Drops database for current model (doctrine-drop-db)
  :generate-admin              Generates a Doctrine admin module
  :generate-migration          Generate migration class (doctrine-generate-migration)
  :generate-migrations-db      Generate migration classes from existing database connections (doctrine-generate-migrations-db, doctrine-gen-migrations-from-db)
  :generate-migrations-models  Generate migration classes from an existing set of models (doctrine-generate-migrations-models, doctrine-gen-migrations-from-models)
  :generate-module             Generates a Doctrine module (doctrine-generate-crud, doctrine:generate-crud)
  :generate-module-for-route   Generates a Doctrine module for a route definition
  :insert-sql                  Inserts SQL for current model (doctrine-insert-sql)
  :migrate                     Migrates database to current/specified version (doctrine-migrate)
  :rebuild-db                  Creates database for current model (doctrine-rebuild-db)
Capítulo 2 - Conexiones »

Questions & Feedback

If you find a typo or an error, please register and open a ticket.

If you need support or have a technical question, please post to the official user mailing-list.