Perforce Chronicle 2012.2/486814
API Documentation

P4_Depot Class Reference

Abstracts operations against Perforce depots. More...

Inheritance diagram for P4_Depot:
P4_Spec_PluralAbstract P4_SpecAbstract P4_ModelAbstract P4_ConnectedAbstract P4_ModelInterface P4_ConnectedInterface

List of all members.

Public Member Functions

 getAddress ()
 Get the address for this depot (for remote depots).
 getDate ()
 Get the date that this specification was last modified.
 getDescription ()
 Get the description for this depot.
 getMap ()
 Get map for the depot.
 getOwner ()
 Get the owner of this depot.
 getSuffix ()
 Get suffix for the depot.
 getType ()
 Get type of this depot.
 setAddress ($address)
 Set address for this depot - for remote depots.
 setDescription ($description)
 Set a description for this depot.
 setMap ($map)
 Set map for this depot.
 setOwner ($owner)
 Set the owner of this depot to passed value.
 setSuffix ($suffix)
 Set suffix for this depot - for spec depots.
 setType ($type)
 Set type for this depot.

Static Public Member Functions

static exists ($id, P4_Connection_Interface $connection=null)
 Determine if the given depot id exists.

Static Protected Member Functions

static _fromSpecListEntry ($listEntry, $flags, P4_Connection_Interface $connection)
 Given a spec entry from spec list output (p4 clients), produce an instance of this spec with field values set where possible.
static _getFetchAllFlags ($options)
 Return empty set of flags for the spec list command as depots takes no arguments.

Static Protected Attributes

static $_accessors
static $_idField = 'Depot'
static $_mutators
static $_specType = 'depot'

Detailed Description

Abstracts operations against Perforce depots.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

static P4_Depot::_fromSpecListEntry ( listEntry,
flags,
P4_Connection_Interface connection 
) [static, protected]

Given a spec entry from spec list output (p4 clients), produce an instance of this spec with field values set where possible.

Parameters:
array$listEntrya single spec entry from spec list output.
array$flagsthe flags that were used for this 'fetchAll' run.
P4_Connection_Interface$connectiona specific connection to use.
Returns:
P4_Client a (partially) populated instance of this spec class.

Reimplemented from P4_Spec_PluralAbstract.

    {
        // time is given as a long - unset to avoid figuring out timezone conversion
        unset($listEntry['time']);
        
        // some values are mapped differently in listEntry
        $listEntry['Depot']       = $listEntry['name'];
        $listEntry['Description'] = $listEntry['desc'];
        unset($listEntry['name']);
        unset($listEntry['desc']);

        return parent::_fromSpecListEntry($listEntry, $flags, $connection);
    }
static P4_Depot::_getFetchAllFlags ( options) [static, protected]

Return empty set of flags for the spec list command as depots takes no arguments.

Parameters:
array$optionsarray of options to augment fetch behavior. see fetchAll for documented options.
Returns:
array set of flags suitable for passing to spec list command.

Reimplemented from P4_Spec_PluralAbstract.

    {
        return array();
    }
static P4_Depot::exists ( id,
P4_Connection_Interface connection = null 
) [static]

Determine if the given depot id exists.

Parameters:
string$idthe id to check for.
P4_Connection_Interface$connectionoptional - a specific connection to use.
Returns:
bool true if the given id matches an existing depot.

Reimplemented from P4_Spec_PluralAbstract.

    {
        // check id for valid format
        if (!static::_isValidId($id)) {
            return false;
        }

        $depots = static::fetchAll(array(), $connection);
        $depot  = $depots->filter(static::$_idField, $id);

        return (bool) count($depots);
    }
P4_Depot::getAddress ( )

Get the address for this depot (for remote depots).

Returns:
string|null address for this depot.
    {
        return $this->_getValue('Address');
    }
P4_Depot::getDate ( )

Get the date that this specification was last modified.

Returns:
string|null Date/Time of last update, formatted "2009/11/23 12:57:06" or null
    {
        return $this->_getValue('Date');
    }
P4_Depot::getDescription ( )

Get the description for this depot.

Returns:
string|null description for this depot.
    {
        return $this->_getValue('Description');
    }
P4_Depot::getMap ( )

Get map for the depot.

Returns:
string|null depot map.
    {
        return $this->_getValue('Map');
    }
P4_Depot::getOwner ( )

Get the owner of this depot.

Returns:
string|null user who owns this record.
    {
        return $this->_getValue('Owner');
    }
P4_Depot::getSuffix ( )

Get suffix for the depot.

Returns:
string|null depot suffix (for spec depots).
    {
        return $this->_getValue('Suffix');
    }
P4_Depot::getType ( )

Get type of this depot.

Will be one of: local/stream/remote/spec/archive.

Returns:
string|null description for this depot.
    {
        return $this->_getValue('Type');
    }
P4_Depot::setAddress ( address)

Set address for this depot - for remote depots.

Parameters:
string | null$addressremote depot connection address.
Returns:
P4_Depot provides a fluent interface.
Exceptions:
InvalidArgumentExceptionaddress is incorrect type.
    {
        if (!is_string($address) && !is_null($address)) {
            throw new InvalidArgumentException('Address must be a string or null.');
        }

        return $this->_setValue('Address', $address);
    }
P4_Depot::setDescription ( description)

Set a description for this depot.

Parameters:
string | null$descriptiondescription for this depot.
Returns:
P4_Depot provides a fluent interface.
Exceptions:
InvalidArgumentExceptiondescription is incorrect type.
    {
        if (!is_string($description) && !is_null($description)) {
            throw new InvalidArgumentException('Description must be a string or null.');
        }

        return $this->_setValue('Description', $description);
    }
P4_Depot::setMap ( map)

Set map for this depot.

Parameters:
string | null$mapdepot map.
Returns:
P4_Depot provides a fluent interface.
Exceptions:
InvalidArgumentExceptionmap is incorrect type.
    {
        if (!is_string($map) && !is_null($map)) {
            throw new InvalidArgumentException('Map must be a string or null.');
        }

        return $this->_setValue('Map', $map);
    }
P4_Depot::setOwner ( owner)

Set the owner of this depot to passed value.

Parameters:
string | null$ownera string containing username.
Returns:
P4_Depot provides a fluent interface.
Exceptions:
InvalidArgumentExceptionowner is incorrect type.
    {
        if (!is_string($owner) && !is_null($owner)) {
            throw new InvalidArgumentException('Owner must be a string or null.');
        }

        return $this->_setValue('Owner', $owner);
    }
P4_Depot::setSuffix ( suffix)

Set suffix for this depot - for spec depots.

Parameters:
string | null$suffixsuffix to be used for generated paths.
Returns:
P4_Depot provides a fluent interface.
Exceptions:
InvalidArgumentExceptionsuffix is incorrect type.
    {
        if (!is_string($suffix) && !is_null($suffix)) {
            throw new InvalidArgumentException('Suffix must be a string or null.');
        }

        return $this->_setValue('Suffix', $suffix);
    }
P4_Depot::setType ( type)

Set type for this depot.

See getType for available options.

Parameters:
string | null$typetype of this depot.
Returns:
P4_Depot provides a fluent interface.
Exceptions:
InvalidArgumentExceptiondescription is incorrect type.
    {
        if (!is_string($type) && !is_null($type)) {
            throw new InvalidArgumentException('Type must be a string or null.');
        }

        return $this->_setValue('Type', $type);
    }

Member Data Documentation

P4_Depot::$_accessors [static, protected]
Initial value:
 array(
        'Owner'         => 'getOwner',
        'Date'          => 'getDate',
        'Description'   => 'getDescription',
        'Type'          => 'getType',
        'Address'       => 'getAddress',
        'Suffix'        => 'getSuffix',
        'Map'           => 'getMap',
    )

Reimplemented from P4_SpecAbstract.

P4_Depot::$_idField = 'Depot' [static, protected]

Reimplemented from P4_Spec_PluralAbstract.

P4_Depot::$_mutators [static, protected]
Initial value:
 array(
        'Owner'         => 'setOwner',
        'Description'   => 'setDescription',
        'Type'          => 'setType',
        'Address'       => 'setAddress',
        'Suffix'        => 'setSuffix',
        'Map'           => 'setMap',
    )

Reimplemented from P4_SpecAbstract.

P4_Depot::$_specType = 'depot' [static, protected]

Reimplemented from P4_SpecAbstract.


The documentation for this class was generated from the following file: