I have been expanding on the Jobeet tutorial by adding a
JobApplication table that includes the JobeetJob id as job_id each
time after each successful application.  All seems to be going well in
the backend app in the application module that by default lists all
the data for each row but I get stuck when I try to join the two
tables and display the job name or location in addition to the data
from JobApplication.

The application module action.class.php file has this added to the
executeIndex function:

$this->jobs = Doctrine::getTable('JobApplication')
      ->createQuery('a')
      ->leftJoin('a.JobeetJob j')
      ->execute();

If you click on the SQL queries link in the dev environment the SELECT
query has been generated successfully:

SELECT j.id AS j__id, j.firstname AS j__firstname, j.surname AS
j__surname, j.email AS j__email, j.salary AS j__salary,
j.salary_currency AS j__salary_currency, j.contract_type AS
j__contract_type, j.relocate AS j__relocate, j.cv_file AS j__cv_file,
j.job_id AS j__job_id, j.created_at AS j__created_at, j.updated_at AS
j__updated_at, j2.id AS j2__id, j2.category_id AS j2__category_id,
j2.location_id AS j2__location_id, j2.company_id AS j2__company_id,
j2.ref AS j2__ref, j2.type AS j2__type, j2.url AS j2__url, j2.position
AS j2__position, j2.location AS j2__location, j2.description AS
j2__description, j2.how_to_apply AS j2__how_to_apply, j2.token AS
j2__token, j2.is_public AS j2__is_public, j2.is_activated AS
j2__is_activated, j2.email AS j2__email, j2.expires_at AS
j2__expires_at, j2.created_at AS j2__created_at, j2.updated_at AS
j2__updated_at FROM job_application j LEFT JOIN jobeet_job j2 ON
j.job_id = j2.id

But, right after this query comes the following query and when I try
to add 'position', 'location' etc to the fields on display I get the
error message 'Unknown record property / related component "position"
on "JobApplication"'.

SELECT j.id AS j__id, j.firstname AS j__firstname, j.surname AS
j__surname, j.email AS j__email, j.salary AS j__salary,
j.salary_currency AS j__salary_currency, j.contract_type AS
j__contract_type, j.relocate AS j__relocate, j.cv_file AS j__cv_file,
j.job_id AS j__job_id, j.created_at AS j__created_at, j.updated_at AS
j__updated_at FROM job_application j ORDER BY j.created_at desc LIMIT
20

The JobApplication table 'job_id' field is linked to the JobeetJob
'id' field but I can't find out how to pull the data from the
JobeetJob table:

  relations:
    JobeetJob: { onDelete: CASCADE, local: job_id, foreign: id,
foreignAlias: JobeetApplications }

Thanks for any insight/assistance on where I am going wrong!

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to