Hello, In my projects I use default ordering feature.
If my table have de RANK column, I change the doSelectRS function:
public static function doSelectRS(Criteria $criteria, $con = null)
{
...
$criteria->setDbName(self::DATABASE_NAME);
$criteria->addAscendingOrderByColumn(self::RANK);
return BasePeer::doSelect($criteria, $con);
}
To get this, I changed addon/propel/builder/SfPeerBuilder.php the
addDoSelectRS function
if ($this->getTable()->getColumn('rank')){
$tmp = str_replace("\$criteria->setDbName(self::DATABASE_NAME);",
"\$criteria-
>setDbName(self::DATABASE_NAME);\n\n".
" //ADD DEFAULT ORDER\n".
" \$criteria-
>addAscendingOrderByColumn(self::RANK);", $tmp);
}
Missing things like:
- Configure default order column in schema.yml
- Include default order in Join funcions.
I would like to include in Propel symfony plugin. To symfony have the
default ordering feature as django's python.
On the other hand, I continued with doSelectJoinAllWithI18n. I would
also like to include in Propel symfony plugin.
Sorry for my Engish, In Spanish:
-------
Hola, En mis proyectos Yo uso la característica de ordenación por
defecto. Para ello si mi tabla tiene la columna RANK
modifico la función doSelectRS:
public static function doSelectRS(Criteria $criteria, $con = null)
{
...
$criteria->setDbName(self::DATABASE_NAME);
$criteria->addAscendingOrderByColumn(self::RANK);
return BasePeer::doSelect($criteria, $con);
}
Para conseguir esto, He cambiado la función addDoSelectRS del archivo
addon/propel/builder/SfPeerBuilder.php:
if ($this->getTable()->getColumn('rank')){
$tmp = str_replace("\$criteria->setDbName(self::DATABASE_NAME);",
"\$criteria-
>setDbName(self::DATABASE_NAME);\n\n".
" //ADD DEFAULT ORDER\n".
" \$criteria-
>addAscendingOrderByColumn(self::RANK);", $tmp);
}
Faltan cosas como:
- Configurar la columan por la que se ordene. (en el archivo
schema.yml)
- Añadir esta característica en las funciones doSelectJoin...
Me gustaría incluir esta característica en el plugin de Propel para
symfony, es decir, que symfony tenga esta característica, al igual
que otros como django.
Por otro lado, continuo con la mejora de rendimiento de propel I18n
(doSelectJoinAllWithI18n). Cosa que tambien me gustaria incluir en
symfony.
--
Un saludo
Rubenrua
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---