Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Multiple JOOMLA USER types and GRID 19 Dec 2016 16:31 #14857

  • jamaza
  • jamaza's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
I have a table called JOBS, and a XRef table called xExpertstoJobs, this XRef has two Joomla User type fields

On a JOBS collection view, I want to pull in the names from BOTH of these fields, however they are not rendering with the correct name and I can only pull in one

In the table view the fields are called expert_id and referrer_id

In the FIELD view at the side to drag them in they are called

user
user

Please Log in or Create an account to join the conversation.

Multiple JOOMLA USER types and GRID 20 Dec 2016 14:48 #14858

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
Hi Jamaza,

I am not sur your Table design is correct in order to use Xref but if i anderstand what you want to do, you should have 3 Tables involved.
- JOBS: (id, title, ...)
- EXPERTS: (id, title, FK [ JUser, ... ]
- xExpertstoJobs (job_id, expert_id, ...)

So with this N:m Pivot Table :
- A Job can needs One or Many Experts Features,
- An Expert can cover One or Many Jobs.

Then, in the Jobs View Layout, you could drag :
- job_title
- - Xref [ExpertstoJobs (on Job)]
- - - Expert_title
- - - FK [Juser]
- - - - Name
- - - - UserName
- - - - etc, etc,

And, in the Experts View Layout, you could drag :
- expert_title,
- FK [Juser]
- - Name
- - UserName
- Xref [ExpertstoJobs (on expert)]
- - FK [job]
- - - job_title

Hoping that can help you ...
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

Last edit: by liubov.

Multiple JOOMLA USER types and GRID 16 Jan 2017 23:02 #14948

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I had a look on your database design

Context I understood :
The 2 FK references to users are located in the EXPERTSTOJOBS table. N:1 relation
You want to list the users from the Jobs table.

Since ORM, this is incredibely simple to achieve.
This should work to grab the datas.
$this->orm(array(
	'relation' => array(

		'xexpertstojobs' => array(
			'select' => array(

				'expert_id.username',
				'expert_id.name',
				
				'referrer_id.username',
				'referrer_id.name',
			)
		)
	)
));
Then dump the loaded datas, and you will see the list of users behind the N:1 relation.

Need more explanation ?

EDIT : You need to download again because I fixed something on the ORM engine that was required for this operation.
Coding is now a piece of cake
The following user(s) said Thank You: MorganL

Please Log in or Create an account to join the conversation.

Last edit: by admin.
  • Page:
  • 1
Time to create page: 0.054 seconds

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started