Overview

Namespaces

  • Apptus
    • ESales
      • Connector
        • Report
        • Time
    • Util
      • Cache
  • PHP
  • Overview
  • Namespace
  • Class
  • Tree
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 
<?php
namespace Apptus\ESales\Connector\Report;

/**
 * A class that holds data for a {@see SessionSummaryReport} or a {@see SessionDetailSummaryReport}.
 */
class Summary {
    private $bounceRate;
    private $orders;
    private $visits;
    private $conversionRate;

    /**
     * @param Rate|null
     * @param int|float
     * @param int|float
     * @param Rate
     */
    public function __construct(Rate $bounceRate = null, $visits, $orders, Rate $conversionRate) {
        $this->bounceRate = $bounceRate !== null ? $bounceRate : Rate::NaN();
        $this->orders = $orders;
        $this->visits = $visits;
        $this->conversionRate = $conversionRate;
    }

    /**
     * @return Rate The bounce rate for this summary or Rate::NaN() if the bounce rate is not present or can not be calculated. i.e. the number of visits is 0.
     */
    public function bounceRate() {
        return $this->bounceRate;
    }

    /**
     * @return int|float
     *            The number of visits that has resulted in at least one order.
     */
    public function orders() {
        return $this->orders;
    }

    /**
     * @return int|float
     *            The number of visits. Each session counts as one visit.
     */
    public function visits() {
        return $this->visits;
    }

    /**
     * @return Rate
     *            The conversion rate for this summary or Rate::NaN() if the conversion rate can not be calculated. i.e. the number of visits is 0.
     */
    public function conversionRate() {
        return $this->conversionRate;
    }
}
Apptus ESales Connector PHP API documentation generated by ApiGen