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: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 
<?php
namespace Apptus\ESales\Connector;

class CategoryList implements Result, \IteratorAggregate {
    private $categories;

    /**
     * @internal
     *
     */
    public function __construct() {
        $this->categories = array();
    }

    /**
     * The number of categories in this result.
     *
     * @return int
     *          the number of categories in this result
     */
    public function size(){
        return sizeof($this->categories);
    }

    /**
     * Return <b>true</b> if this result is empty and false otherwise.
     *
     * @return boolean
     *          <b>true</b> if this result is empty and false otherwise
     */
    public function isEmpty(){
        return empty($this->categories);
    }

    /**
     * Get the list of categories in this result. The list is an array of CategoryData objects.
     *
     * @return array
     *          the categories list
     */
    public function getCategories() {
        return $this->categories;
    }

    /**
     * @internal
     * @param CategoryData $category
     */
    function addCategory(CategoryData $category) {
        array_push($this->categories, $category);
    }

    public function __toString() {
        return implode(",", $this->categories);
    }

    public function getIterator() {
        return new \ArrayIterator($this->categories);
    }

    /**
     * Get the result type of this result.
     *
     * @return string The result type.
     * @see ResultType
     */
    public function getType() {
        return ResultType::CATEGORY_LIST;
    }
}
Apptus ESales Connector PHP API documentation generated by ApiGen