Robust
Well-known member
I'm no PHP expert so I'm not really someone to be criticising if others are getting along with this fine, but now I think it's usual to use query builders to access the DB. I think Laravel is a perfect example of good approaches to modern PHP approaches.
http://laravel.com/docs/5.1/eloquent
It's much easier to work with that, and I can do what takes a lot of lines in XF (to do properly, anyway).
So, is there any other way in XF 1.5 to do what I'm looking to do (will describe below). I'm assuming (and hoping) that XF 2.0 will have significant improvements to developer workflow, reducing unnecessary work, using modern approaches and reducing boilerplate and repetition of code, but until then...
My aim is to access the same table to get something. So, say for action 1 I need to get just general info from the table like the title and description. In action 2, I need to get title, description, more data like user IDs etc. In action 3, I need to get the info in action 2, plus left join about 4-5 other tables in to fetch specific data from the unique IDs stored in the table I got the title and description from. In action 4 I need to get the data in action 2, but fetch the user too.
So really, it's just the case of in some actions/controller functions I need to get more data, others I need more joins to fetch data associative to the IDs that already exist.
Right now, I'd probably be expected to compare bitwise operators but bits are beyond something I know and really I don't want to bother work with them if they're outdated technologies that aren't really used anymore. There's probably more modern and nicer approaches to it. I mean, there's always check if a string is set and if it is do an action, but something that doesn't involve that action at all, possibly.
Thanks
http://laravel.com/docs/5.1/eloquent
It's much easier to work with that, and I can do what takes a lot of lines in XF (to do properly, anyway).
So, is there any other way in XF 1.5 to do what I'm looking to do (will describe below). I'm assuming (and hoping) that XF 2.0 will have significant improvements to developer workflow, reducing unnecessary work, using modern approaches and reducing boilerplate and repetition of code, but until then...
My aim is to access the same table to get something. So, say for action 1 I need to get just general info from the table like the title and description. In action 2, I need to get title, description, more data like user IDs etc. In action 3, I need to get the info in action 2, plus left join about 4-5 other tables in to fetch specific data from the unique IDs stored in the table I got the title and description from. In action 4 I need to get the data in action 2, but fetch the user too.
So really, it's just the case of in some actions/controller functions I need to get more data, others I need more joins to fetch data associative to the IDs that already exist.
Right now, I'd probably be expected to compare bitwise operators but bits are beyond something I know and really I don't want to bother work with them if they're outdated technologies that aren't really used anymore. There's probably more modern and nicer approaches to it. I mean, there's always check if a string is set and if it is do an action, but something that doesn't involve that action at all, possibly.
Thanks