Welcome Guest, Not a member yet? Register   Sign In
Question about module usage
#5

[eluser]osci[/eluser]
func_get_args looks quite interesting in the way that it could provide me with method overloading and maybe in conjunction with the reflection API it could help in models too.

This [url|http://www.php.net/manual/en/function.func-get-args.php#85354](first) example[/url] shows a way to get polymorphic/"overloaded" function which is quite helpful in my situation.

Also since I have different schema for multilingual and single language sites (for db optimization) this [url|http://www.php.net/manual/en/function.func-get-args.php#78583](second) example[/url] shows how I could load a different class (model) based on constructor arguments which is quite nice too, although I could solve this issue with the previous example and accordingly load the appropriate model but that wouldn't be really dry (there should be a base model and client models in this case extend or override base model).

To conclude controllers would use "overload example" above to do extended tasks and lead to a _base_function which would be the non changed one (more basic implementation I suppose). As for second example I might try it in order to have different schema model (currently there is one model with conditional schema but it's bloating code) and keep models a little more clean and independent. Otherwise I'll load different model according to first example.

Got to keep on RnD.

Thanks InsiteFX. I think my solution is somewhere there.

EDIT:
Of course if anyone has another suggestion I'm all ears Smile


Messages In This Thread
Question about module usage - by El Forum - 06-16-2011, 11:24 AM
Question about module usage - by El Forum - 06-16-2011, 11:45 PM
Question about module usage - by El Forum - 06-17-2011, 03:21 AM
Question about module usage - by El Forum - 06-17-2011, 05:51 AM
Question about module usage - by El Forum - 06-17-2011, 11:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB