PHP Class Puli\Repository\Api\ChangeStream\VersionList

Since: 1.0
Author: Titouan Galopin ([email protected])
Author: Bernhard Schussek ([email protected])
Inheritance: implements IteratorAggregat\IteratorAggregate, implements ArrayAcces\ArrayAccess, implements Countabl\Countable
Mostra file Open project: puli/repository

Public Methods

Method Description
__construct ( string $path, array $versions ) Creates a new version list.
contains ( integer $version ) : boolean Returns whether a specific version exists.
count ( )
get ( integer $version ) : Puli\Repository\Api\Resource\PuliResource Returns a specific version of the resource.
getCurrent ( ) : Puli\Repository\Api\Resource\PuliResource Returns the current version of the resource.
getCurrentVersion ( ) : integer Returns the current version number.
getFirst ( ) : Puli\Repository\Api\Resource\PuliResource Returns the first version of the resource.
getFirstVersion ( ) : integer Returns the first version number.
getIterator ( )
getPath ( ) : string Returns the path of the versioned resources.
getVersions ( ) : int[] Returns all version numbers.
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
toArray ( ) : Puli\Repository\Api\Resource\PuliResource[] Returns the list as array indexed by version numbers.

Method Details

__construct() public method

Creates a new version list.
public __construct ( string $path, array $versions )
$path string The Puli path.
$versions array The versions of the resource, starting with the first.

contains() public method

Returns whether a specific version exists.
public contains ( integer $version ) : boolean
$version integer The version number starting at 0.
return boolean Whether the version exists.

count() public method

public count ( )

get() public method

Returns a specific version of the resource.
public get ( integer $version ) : Puli\Repository\Api\Resource\PuliResource
$version integer The version number starting at 0.
return Puli\Repository\Api\Resource\PuliResource The resource.

getCurrent() public method

Returns the current version of the resource.
public getCurrent ( ) : Puli\Repository\Api\Resource\PuliResource
return Puli\Repository\Api\Resource\PuliResource The current version.

getCurrentVersion() public method

Returns the current version number.
public getCurrentVersion ( ) : integer
return integer The current version number.

getFirst() public method

Returns the first version of the resource.
public getFirst ( ) : Puli\Repository\Api\Resource\PuliResource
return Puli\Repository\Api\Resource\PuliResource The first version.

getFirstVersion() public method

Returns the first version number.
public getFirstVersion ( ) : integer
return integer The first version number.

getIterator() public method

public getIterator ( )

getPath() public method

Returns the path of the versioned resources.
public getPath ( ) : string
return string The Puli path.

getVersions() public method

Returns all version numbers.
public getVersions ( ) : int[]
return int[] The version numbers.

offsetExists() public method

public offsetExists ( $offset )

offsetGet() public method

public offsetGet ( $offset )

offsetSet() public method

public offsetSet ( $offset, $value )

offsetUnset() public method

public offsetUnset ( $offset )

toArray() public method

Returns the list as array indexed by version numbers.
public toArray ( ) : Puli\Repository\Api\Resource\PuliResource[]
return Puli\Repository\Api\Resource\PuliResource[] The resource versions indexed by their version numbers.