Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2008
    Location
    Ohio
    Posts
    21
    Plugin Contributions
    0

    Default 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.
    Matthew G
    www.g6enterprises.com
    ZenCart 1.3.8a

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default 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.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Nov 2008
    Location
    Ohio
    Posts
    21
    Plugin Contributions
    0

    Default Re: Code Question "->"

    Thanks. I found a very basic tutorial on PHP classes and objects and $this->makes_more_sense_now ().
    Matthew G
    www.g6enterprises.com
    ZenCart 1.3.8a

 

 

Similar Threads

  1. Change "Redemption Code" to "Coupon Code"?
    By carol2848 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 30 May 2011, 07:07 PM
  2. Replies: 3
    Last Post: 3 Jun 2008, 11:41 AM
  3. How to Change "Redemption Code" to "Coupon Code" & "GV Code"
    By dmfelder in forum Basic Configuration
    Replies: 5
    Last Post: 16 Apr 2008, 05:50 PM
  4. For images, does "base" = "small"? And a question about alternates.
    By molywerks in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 29 Feb 2008, 02:49 PM
  5. Quick "where is this code?" question....
    By Ripper in forum General Questions
    Replies: 3
    Last Post: 19 Feb 2008, 09:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg