[email protected] Posted April 13, 2016 Share Posted April 13, 2016 Hello everybody ! I researched class PrestashopCollection but i can't use function join with to another table Example: orders table join with address table on id_customer key $orders = new PrestaShopCollection('Order'); $orders->join(string association, string on); //string association=?? $orders->where('column', '=', $variable); Link to comment Share on other sites More sharing options...
bellini13 Posted April 13, 2016 Share Posted April 13, 2016 First, if you join orders and address tables together on id_customer, then you are going to get all addresses for that customer, not only the address associated with that order. I searched the prestashop code, and I do not see that the join function is used anywhere outside of the PrestaShopCollection class, so this function may not be designed for you to use, even though it is a public function. What exactly are you trying to do? Why not use DbQuery instead? Link to comment Share on other sites More sharing options...
[email protected] Posted April 13, 2016 Author Share Posted April 13, 2016 First, if you join orders and address tables together on id_customer, then you are going to get all addresses for that customer, not only the address associated with that order. I searched the prestashop code, and I do not see that the join function is used anywhere outside of the PrestaShopCollection class, so this function may not be designed for you to use, even though it is a public function. What exactly are you trying to do? Why not use DbQuery instead? Thanks your answer... but i want to research how can use class PrestaShopCollection with function join in this class... And waitting... Link to comment Share on other sites More sharing options...
bellini13 Posted April 14, 2016 Share Posted April 14, 2016 well then I suggest you start researching the answer for yourself. As I said before, Prestashop does not use the join function outside of the PrestaShopCollection class. They only use it inside the PrestaShopCollection class. So start reading the code inside PrestaShopCollection class to see how they use it Link to comment Share on other sites More sharing options...
Ali Samie Posted November 9, 2023 Share Posted November 9, 2023 It's so fun to read PrestaShop forums for questions. Seems like this platform is dead and left behind. Everything is a mystery and does not work as expected. Thank you so much for wasting the time of developers. Link to comment Share on other sites More sharing options...
Ali Samie Posted November 9, 2023 Share Posted November 9, 2023 1 minute ago, dnk.hack said: Hello, can you explain what you want to do? If you want to build a DB query you have to use DbQuery class Bro, the last time that this account was online was in 2016. I guess that they realized they need to use a better framework back then. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now