Overview

Namespaces

  • Apptus
    • ESales
      • Connector
        • Report
        • Time
    • Util
      • Cache
  • PHP

Classes

  • Ad
  • Ads
  • ArgMap
  • Attribute
  • AttributeValidation
  • Authorization
  • Category
  • CategoryData
  • CategoryList
  • CategoryNode
  • CloudConnector
  • ClusterUriIterator
  • Completion
  • Completions
  • CompressionMode
  • Connector
  • ConnectorSettingsBuilder
  • Correction
  • Corrections
  • Count
  • CssClass
  • CustomerKeyAuthentication
  • DynamicPage
  • EventDataJobResult
  • FacetList
  • FacetRange
  • Facets
  • Filter
  • FilterBuilder
  • ImportData
  • JavaScriptNotifier
  • MessageAuthentication
  • OnPremConnector
  • Order
  • OrderLine
  • Panel
  • PanelContent
  • Path
  • Phrase
  • Phrases
  • Product
  • Products
  • Reporter
  • ResultType
  • Session
  • Status
  • Subpanel
  • Value
  • Values
  • Variant

Interfaces

  • Facet
  • Result

Exceptions

  • BusyClusterException
  • ClusterUnavailableException
  • DuplicateSubpanelException
  • FetchClusterException
  • IOException
  • MalformedJsonException
  • MalformedURLException
  • MissingSubpanelException
  • PanelException
  • ParseException
  • ReportException
  • RequestFailedException
  • ResultTypeException
  • Overview
  • Namespace
  • Class
  • Tree

Class Path

Convenience class for working with panel paths.

Namespace: Apptus\ESales\Connector
Located at Connector/Path.php
Methods summary
public static string
# root( )

Returns a path denoting the root, '/'.

Returns a path denoting the root, '/'.

Returns

string
public static string
# childPath( string $path, string $name )

Returns a new path denoting a specified child element of the element denoted by this path.

Returns a new path denoting a specified child element of the element denoted by this path.

For instance, Path::childPath('/an/example/', 'child') is equal to '/an/example/child'.

Parameters

$path
path.
$name
name of the child element.

Returns

string
A path denoting the child element.

Throws

InvalidArgumentException
if name contains illegal characters.
public static string
# parentPath( string $path )

Returns a new path denoting the parent element of the element denoted by this path.

Returns a new path denoting the parent element of the element denoted by this path.

For instance, Path::parentPath('/an/example/') is equal to '/an'.

Parameters

$path
path.

Returns

string
A new path denoting the parent element.

Throws

InvalidArgumentException
public static array
# ancestors( string $path )

Returns all the ancestors to a path, starting with the closest.

Returns all the ancestors to a path, starting with the closest.

For instance, Path::ancestors('/an/example/path') will return an indexed array containing the paths: '/an/example', '/an' and '/' in that order.

Parameters

$path
path.

Returns

array
A list of ancestor path strings.

Throws

InvalidArgumentException
public static string
# simpleName( string $path )

Returns the simple name of the element denoted by this path.

Returns the simple name of the element denoted by this path.

For instance, Path::simpleName('/an/example') becomes 'example'.

Parameters

$path
path.

Returns

string
public static boolean
# isRoot( string $path )

True if this path denotes the root '/', false otherwise.

True if this path denotes the root '/', false otherwise.

Parameters

$path
path.

Returns

boolean
public static boolean
# hasParent( string $path )

True if this path has a parent path.

True if this path has a parent path.

Parameters

$path
path.

Returns

boolean
public static integer
# length( string $path )

Returns the number of components in a path.

Returns the number of components in a path.

The root (/) has length 1.

Parameters

$path
path.

Returns

integer
public static string
# ancestor( string $path, integer $length )

Returns the ancestor of length $length of a path.

Returns the ancestor of length $length of a path.

For instance, Path::ancestor('/a/b/c/d', 3) returns /a/b, since /a/b is the ancestor of /a/b/c/d with length 3.

Parameters

$path
path.
$length

Returns

string
public static string
# endpath( string $path, integer $start )

Returns an end path of a path.

Returns an end path of a path.

For instance, Path::endpath('/a/b/c/d', 2) returns the relative path b/c/d, since the prefix /a of length 2 is cut.

Parameters

$path
path.
$start

Returns

string

Throws

InvalidArgumentException
public static string
# descendant( string $path, string $endpath )

Returns a descendant of a path.

Returns a descendant of a path.

For instance, Path::descendant('/a/b', 'c/d') returns the path '/a/b/c/d'.

Parameters

$path
$endpath

Returns

string
public static boolean
# hasAncestor( string $path, string $ancestor )

Returns true if this path has an ancestor as specified by the $ancestor argument. Otherwise, returns false.

Returns true if this path has an ancestor as specified by the $ancestor argument. Otherwise, returns false.

For instance, Path::hasAncestor('/a/b/c', '/a') returns true, while Path::hasAncestor('/a/b', '/c') return false.

Parameters

$path
$ancestor

Returns

boolean
Constants summary
string SEPARATOR
# '/'
Apptus ESales Connector PHP API documentation generated by ApiGen