diff --git a/013-dynamicGet.md b/013-dynamicGet.md index abafe42..eb8a0e9 100644 --- a/013-dynamicGet.md +++ b/013-dynamicGet.md @@ -62,17 +62,16 @@ Coming back to this 'Join View Tables' area. Let's again look at the database ta ### Dynamic Get Filters - Where - Ordering - Globals -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'.<<<<<<<<<<<<< +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) It is the different set types. You can set the value to 'State' or you can set the value to 'This'. + +It is nessesary to know the key. If for example 'name' is used: In this case it is not going to work because there is more than one name. Usually this global function only functions well when you are returning a single item.[00:25:01](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m01s) When 'getitem' not 'getlistquery' is done, it makes 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 model methods which are custom methods. That is setting the global. [00:25:24](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m24s) There is a list of possible filtering. Depending on what needs to be done, 'ID','user', 'access, 'level', 'group', 'category', 'tags' or 'date' may be selected.[00:25:45](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m45s) 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. The function 'variable' works well. As well as 'array', 'value', 'repeatable value'', and other work very well. You can use them and implement them. [00:26:15](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m15s) The only way to know exactly how it works is 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 all this is 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)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - 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. + 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 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. ### Dynamic Get Get Access( Default added)