Zen Cart Logo
Forums / General Questions / Code Question "->"

Code Question "->"

Locked

Views: 540

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
21 Feb 2009, 11:17 PM
#1
g6enterprises avatar

g6enterprises

New Zenner

Join Date:
Nov 2008
Location:
Ohio
Posts:
21
Plugin Contributions:
0

Code Question "->"

I've gone through several online PHP and MySQL tutorials, and I've never seen this operator in any of them: "->" But it's all over in the zen cart code, for example:
$sale = $db->Execute("select sale_specials_condition, sale_deduction_value, sale_deduction_type from " . TABLE_SALEMAKER_SALES . " where sale_categories_all like '%," . $category . ",%' and sale_status = '1' and (sale_date_start <= now() or sale_date_start = '0001-01-01') and (sale_date_end >= now() or sale_date_end = '0001-01-01') and (sale_pricerange_from <= '" . $product_price . "' or sale_pricerange_from = '0') and (sale_pricerange_to >= '" . $product_price . "' or sale_pricerange_to = '0')");
if ($sale->RecordCount() < 1) {
return $special_price;

Could someone please enlighten me as to the exact meaning and usage of this? I would appreciate it.

21 Feb 2009, 11:34 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Code Question "->"

In the examples you've given, it invokes a class method i.e. $classObject->method(). For example, invoking the "Execute" method that forms part of the class used to form the $dB object. You'll see a whole lot more of this in Zen Cart 2.0. I recommend reading up specifically on PHP classes to learn more.

22 Feb 2009, 3:04 AM
#3
g6enterprises avatar

g6enterprises

New Zenner

Join Date:
Nov 2008
Location:
Ohio
Posts:
21
Plugin Contributions:
0

Re: Code Question "->"

Thanks. I found a very basic tutorial on PHP classes and objects and $this->makes_more_sense_now (). :smile: