Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Missing calculated field in relationship
Re: Missing calculated field in relationship [message #2250 is a reply to message #2249] Mon, 10 August 2009 18:10 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
I have run a test using the XAMPLE subsystem which is contained in the Radicore download. I changed the relationship between X_PERSON and X_PERSON_ADDR so that it reads as follows:
$this->parent_relations[]     = array('parent' => 'x_person',
                                      'parent_field' => 'CONCAT(first_name, \' \', last_name) AS person_name, value1, value2',
                                      'fields' => array('person_id' => 'person_id'));

When I ran the task it gebnerate the following SQL query:
SELECT SQL_CALC_FOUND_ROWS x_person_addr.*, CONCAT(x_person.first_name,' ',x_person.last_name) AS person_name, x_person.value1, x_person.value2 
FROM x_person_addr 
LEFT JOIN x_person ON (x_person.person_id=x_person_addr.person_id) 
WHERE x_person_addr.person_id='PA'   
ORDER BY x_person_addr.person_id, x_person_addr.address_no  
LIMIT 10 OFFSET 0

As you can see it successfully retrieves multiple fields from the parent table. Can you step through with your debugger to see how the problem relationship is prcessed in the _sqlForeignJoin() method within 'std.table.class.inc'?


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Use of $this->skip_validation
Next Topic: how can i change a textfield row into dropdown control?
Goto Forum:
  


Current Time: Mon Nov 18 22:09:47 EST 2024

Total time taken to generate the page: 0.01080 seconds