The sfDoctrineTablePlugin generates feature packed base tables to each model.
Base table contains PHPDocs of available pre-generated WHERE, COUNT
and JOIN considering table relations and its depth. List of new available
methods are accessed through the PHPDoc tag @method and are suitable for IDE
users only.

Plugin generates feature packed base tables to each model. Base table contains PHPDocs of available pre-generated WHERE, COUNT and JOIN considering table relations and its depth. List of new available methods are accessed through the PHPDoc tag @method and are suitable for IDE users only.

Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release 1.0.3 - 19/10/2011

sfDoctrineTablePlugin

The sfDoctrineTablePlugin generates feature packed base tables to each model.
Base table contains PHPDocs of available pre-generated WHERE, COUNT
and JOIN considering table relations and its depth. List of new available
methods are accessed through the PHPDoc tag @method and are suitable for IDE
users only (prefect implementation in NetBeans 7.1)

Plugin helps you not to remember tables relation aliases and escape from the constructing left and/or inner joins.
It gives you ability to use pre-generated methods with IDE code-completion
to speed-up your coding. Also, you could add your owns methods to the generator's
template by extending it.

By default base tables will be generated to all models and to all enabled
plugins that contains schema files. Occasionally, you won't use
all models to query its data, some of them will be used to save data. In
such cases is reasonable to disable the base tables generation. How to do that
please refer to 5.4. Turning off base table generation for
specific models.

According to my own experience, the most profit you will get in case you disable
automatic relation detection (detect_relations: false) and setup only important
to you relations by hand. Advantages to the solutions are clear generated method
names and small file size (APC will be thankful to you).

SELECT
c.id AS c__id, c.country_id AS c__country_id, c.title AS c__title,
c2.id AS c2__id, c2.capital_city_id AS c2__capital_city_id, c2.title AS c2__title,
c3.id AS c3__id, c3.country_id AS c3__country_id, c3.title AS c3__title,
c4.id AS c4__id, c4.capital_city_id AS c4__capital_city_id, c4.title AS c4__title
FROM city c
INNER JOIN country c2 ON c.country_id = c2.id
LEFT JOIN city c3 ON c2.capital_city_id = c3.id
LEFT JOIN country c4 ON c3.id = c4.capital_city_id

Given below statistical numbers are generated for production environment
with --minified flag and enabled APC:

Here is time cost to initialize new table instance (e.g. Doctrine::getTable('MyTable'))
with generated base table and without.
As you could notice, this it pretty large table with 26 relations and 19 columns.
It demonstrates that even big table load time is slower than 0.00142 s. comparing
to a default initialization time.

All the more so it's just first time you initialize any table, all following
table initializations will be comparatively slower than 0.0001 s.