Updated 013 dynamicGet (markdown)

Amigo 2019-06-14 10:07:28 +02:00
parent 16e8e04579
commit 8d19a4cbf4
1 changed files with 6 additions and 5 deletions

@ -27,16 +27,17 @@ If the main purpose of the view is to show a list of preachers, then 'getlistque
### Join Data Views - Tables
In this area(see video) is data and this data can be joined to other database tables. In this area(See video) like with the main source it is possible to select joint views from a table.[00:08:57](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m57s) A view table which is the views of the component or just any database table. To one of the database tables I often connect to categories. Component builder integrates it's application. If you add a category field to any view, [00:09:22](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m22s) it dynamically set up a category for your component. And integrates the category concept into your component, so it writes all that code for you and the way that Joomla's own applications like article manager does it. It's using the same conventions. If you know how Joomla article manager is bringing categories into the articles, then that is the way your component is going to do it. Here(DB Table - cb_categories) you can select categories. [00:09:54](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m54s) These switches, I'll deal with them when we come and look in more detail at this area. Then you can model the data there(Selection). With 'Model' is meant to decide what needs to be returned, as not everything needs to be returned from categories. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
In this area(see video) is data and this data can be joined to other database tables. In this area(See video) like with the main source it is possible to select joint views from a table.[00:08:57](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m57s) A view table which is the views of the component or just any database table. One of the database tables I often connect to, is categories. Component Builder integrates it's application if you add a category field to any view, it dynamically sets up a category for your component and integrates the category concept into your component.[00:09:22](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m22s) So it writes all that code and Joomla's own applications, like Article Manager does it. It's using the same conventions. If you know how Joomla article manager is bringing categories into the articles, then that is the way your component is going to do it. Here at 'DB Table - cb_categories' you can select categories. [00:09:54](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m54s) These switches, will be dealt with in more detail when this area will be discussed. In the 'Selection' area the data can be modeled . With 'Model' is meant to decide what needs to be returned, as not everything needs to be returned from categories. More about the Data Base(DB) later in this tutorial.<<<<<<<<<<<<<<<<<<<,
### Join View Tables Example
But the one I want to look at first is actually this joint view table. We'll come back to the DB option. The joint view Table, let you again select from any of the other views that is part of your component. [00:10:25](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m25s) Again you can select whether it should return a single row or a list of rows. When you say single row, it means it's going to join it to this other data set that you have as your main data or your main source. It will just be another item in the array. That's why you can't use the name 'Name' for example here. [00:10:51](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m51s) It needs to have that series_ in front of it. So that it doesn't clash with the other data set that possibly also has a value called name. So again if you select anything here(Scaling Factor - dropdown), Series, you will see that it will populate this(Selection) area with all the fields that is in that view. Then this 'AS' button here, [00:11:21](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m21s) you can't use the same alphabetic number twice in the whole query. The whole get function can only use 'a' once and then 'b' once and then 'c' once and then 'd'. [00:11:40](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m40s) We'd made provision up to z z. That is how many tables you can have. Only in this area here(AS).
The joint view Table, let you again select from any of the other views that is part of your component. [00:10:25](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m25s) Again you can select whether it should return a single row or a list of rows. When you say single row, it means it's going to join it to this other data set that you have as your main data or your main source. It will just be another item in the array. That's why you can't use the name 'Name' for example here. [00:10:51](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m51s) It needs to have that series_ in front of it. So that it doesn't clash with the other data set that possibly also has a value called name. So again if you select anything here(Scaling Factor - dropdown), Series, you will see that it will populate this(Selection) area with all the fields that is in that view. Then this 'AS' button here, [00:11:21](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m21s) you can't use the same alphabetic number twice in the whole query. The whole get function can only use 'a' once and then 'b' once and then 'c' once and then 'd'. [00:11:40](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m40s) We'd made provision up to z z. That is how many tables you can have. Only in this area here(AS).
You would first decide whether this 'Return Row Type', what type of return it will be? If you set it to multiple, these names automatically update. [00:12:02](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m02s) The way that the get method will work, is it will create a new method which will get this data and add it into your item list via this relationship. I'm adding the 'On Field' as the a.series that's where the id is for the series. [00:12:24](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m24s) In the joint field, I'm using the 'c.id'. In the main database, that is the 'a' database, there must be a field called series. It has the id of the series. It corresponds to the id in this list. If I wanted to return a multiple, it means that the main database which is in this case sermon, can be linked to multiple series's.