On 05/15/2010 10:42 PM, Garry Freemyer wrote:
I looked over google till my eyes bled. I do not find any explanation as to why the 'a' is used as a parameter to createQuery in the code below. I don't like being left in the dark. Can someone explain what this is doing?

The url for the jobeet tutorial non-explained code is ...
http://www.symfony-project.org/jobeet/1_4/Doctrine/en/04

From http://www.doctrine-project.org/projects/orm/1.2/api:

(navigate to the Doctrine_Table class[1])
<http://www.doctrine-project.org/api/orm/1.2/doctrine/doctrine_table.html#createQuery%28%29>
|public Doctrine_Query <http://www.doctrine-project.org/api/orm/1.2/doctrine/doctrine_query.html> *createQuery*(string alias)|

Creates a query on this table.

This method returns a new Doctrine_Query object and adds the component name of this table as the query 'from' part. |$table = Doctrine_Core::getTable('User'); $table->createQuery('myuser') ->where('myuser.Phonenumber = ?', '5551234'); |

I.e. the 'a' is an alias you use when you add conditions to the query.

1. http://www.doctrine-project.org/api/orm/1.2/doctrine/doctrine_table.html

Regards,
Tarjei


/ apps/frontend/modules/job/actions/actions.class.php
class  jobActionsextends  sfActions
{
   public  function  executeIndex(sfWebRequest$request)
   {
     $this->jobeet_jobs  = Doctrine::getTable('JobeetJob')
       ->createQuery('a')
       ->execute();
   }

   // ...
}
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to