/** * Constructs a new instance of OrderByPathSegment * * @param array(OrderBySubPathSegment) $orderBySubPathSegments Collection of * orderby sub path * segments for * this path segment. * @param boolean $isAscending sort order, * True for * ascending and * false * for desending. */ public function __construct($orderBySubPathSegments, $isAscending = true) { if (!is_array($orderBySubPathSegments)) { throw new \InvalidArgumentException(Messages::orderByPathSegmentOrderBySubPathSegmentArgumentShouldBeNonEmptyArray()); } if (empty($orderBySubPathSegments)) { throw new \InvalidArgumentException(Messages::orderByPathSegmentOrderBySubPathSegmentArgumentShouldBeNonEmptyArray()); } $this->_orderBySubPathSegments = $orderBySubPathSegments; $this->_isAscending = $isAscending; }