PHP Option on two tables
PHP Option on two tables
nessinits
Posts: 86Questions: 27Answers: 0
Hi,
Is it possible to join two tables in the PHP option class?
Field::inst( 'users.site' )
->options( Options::inst()
->table( 'sites' )
->value( 'id' )
->label( 'name' )
)
In the example table is "sites", but is it possible to connect it to another table, for example the table domains" and do a where domains.sites_id = sites.id?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Currently no - sorry. The built in Options class doesn't not have a join option, although I've now added that to the list of features to add.
At the moment you would need to use a custom function to get the options with a database call.
Thanks,
Allan
Thanks Allan, I'll solve this with a view on those tables until it's supported.
Good idea - I should have thought of that as well. Thanks for noting that.
Allan