Jump to content

Pls help how to use class PrestashopCollection!


lovesingle@gmail.com

Recommended Posts

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

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

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

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

  • 7 years later...
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.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...