Updated 013 dynamicGet (markdown)

Amigo 2019-06-17 12:04:15 +02:00
parent 01edb304ca
commit f172d23946
1 changed files with 9 additions and 5 deletions

@ -58,14 +58,18 @@ Returning to the dynamic get, it can be seen that there is a custom script area.
### Dynamic Get Join DB Tables
Coming back to this 'Join View Tables' area. Let's again look at the database table option. If category is selected and it's a single row that is returned. It is called 'b'. It is joined to the left, and set 'a.catid' that it should be equal to 'b.id', which is the 'id' of the category. Only a title and the alias is needed. That is [00:23:44](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m44s) how it is set up. Only the title and the alias is nessesary and it is been returned. Then it links it in there(see video), and that's part of what is seen here when viewing the query option, it is the sixth section.<<<<<<<
Coming back to this 'Join View Tables' area. Let's again look at the database table option. If category is selected and it's a single row that is returned. It is called 'b'. It is joined to the left, and set 'a.catid' that it should be equal to 'b.id', which is the 'id' of the category. Only a title and the alias is needed. That is [00:23:44](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m44s) how it is set up. Only the title and the alias is nessesary and it is been returned. Then it links it in there(see video), and that's part of what is seen here when viewing the query option, it is the sixth section.
### Dynamic Get Filters - Where - Ordering - Globals
Now let's look at the filters where we have a filter and an ordering and setting of globals. [00:24:12](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m12s) The setting of globals is if you have a value in this query that you want to use in a custom query, which isn't even setup yet, but you want you know I'm going to need this value in the model. Then you can through this global option here, you can set a global area. Here you should maybe test it. There is an option of using 'This' and 'State'. [00:24:38](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m38s) There is the different of set types. You can set the value to 'State' or you can set the value to 'This'. Here you need to know the key. I want to do the name, in this case is not going to work. Because you got more than one name. Usually this global function only functions well [00:25:01](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m01s) when you are returning a single item. When you do getitem not getlistquery, but you do getitem, then this make sense and then you can give it a name. It will add it to the global scope of the model which you can access through other [00:25:24](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m24s) model methods. which are custom methods. That is setting the global.
Taking a look at the filters. Here is a 'filter',a'where', an 'ordering' and a 'setting' of globals. [00:24:12](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m12s) The 'setting' of globals is if you have a value in this query that you possibly want to use in a custom query, which isn't even setup yet, but you want to know if this value is needed in the model. Then through this global option here, a global area can be set. Maybe it should be tested here(See video) . There is an option of using 'This' and 'State'. [00:24:38](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m38s) Where it is the different set types. You can set the value to 'State' or you can set the value to 'This'.<<<<<<<<<<<<<
Here you need to know the key. I want to do the name, in this case is not going to work. Because you got more than one name. Usually this global function only functions well [00:25:01](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m01s) when you are returning a single item. When you do getitem not getlistquery, but you do getitem, then this make sense and then you can give it a name. It will add it to the global scope of the model which you can access through other [00:25:24](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m24s) model methods. which are custom methods. That is setting the global.
The filtering you have a a list of possible filtering. Depending on what you want to do. You might select id, or user, access, level, group, category, [00:25:45](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m45s) tags or date. Some of these are not formulated yet. Like date doesn't work that well yet. Categories does, user, group, access level, user and id does well. This function variable works well. As well as array, value, repeatable value, and other all those already work very well. You can use them and implement them. The only way for you to [00:26:15](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m15s) know exactly how it works you need to know a little PHP, and then you need to compile it and go look in the code what it has done and where it's placed what. That is why I showed you that this is all set in the model. Currently we are saying we wanted to do a JRequest::getint by id. [00:26:39](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m39s) This is the get area that I added. I look in the code it says 'State Key' and it's this(JRequest::getint by id) here. We set it is a function variable. It doesn't change or adapt this at all. Then says it must be equal to preacher. What we are doing, since component builder doesn't know where the this variable is going to be a string or integer, that's why we have this function which first checks were that is string, [00:27:08](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m08s) and then checks whether it's a number.
It related and builds up the query respectively. You might feel that is too much and you're possibly right. But that is the only way I am implement it at this stage. Getting more developers involved may possibly improve this long run.