Abstracts operations against Perforce depots.
More...
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 | $listEntry | a single spec entry from spec list output. |
array | $flags | the flags that were used for this 'fetchAll' run. |
P4_Connection_Interface | $connection | a specific connection to use. |
- Returns:
- P4_Client a (partially) populated instance of this spec class.
Reimplemented from P4_Spec_PluralAbstract.
{
unset($listEntry['time']);
$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 | $options | array 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.
Determine if the given depot id exists.
- Parameters:
-
- Returns:
- bool true if the given id matches an existing depot.
Reimplemented from P4_Spec_PluralAbstract.
{
if (!static::_isValidId($id)) {
return false;
}
$depots = static::fetchAll(array(), $connection);
$depot = $depots->filter(static::$_idField, $id);
return (bool) count($depots);
}
Get the address for this depot (for remote depots).
- Returns:
- string|null address for this depot.
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
P4_Depot::getDescription |
( |
| ) |
|
Get the description for this depot.
- Returns:
- string|null description for this depot.
Get map for the depot.
- Returns:
- string|null depot map.
Get the owner of this depot.
- Returns:
- string|null user who owns this record.
Get suffix for the depot.
- Returns:
- string|null depot suffix (for spec depots).
Get type of this depot.
Will be one of: local/stream/remote/spec/archive.
- Returns:
- string|null description for this depot.
P4_Depot::setAddress |
( |
$ |
address | ) |
|
Set address for this depot - for remote depots.
- Parameters:
-
string | null | $address | remote depot connection address. |
- Returns:
- P4_Depot provides a fluent interface.
- Exceptions:
-
InvalidArgumentException | address 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 | $description | description for this depot. |
- Returns:
- P4_Depot provides a fluent interface.
- Exceptions:
-
InvalidArgumentException | description 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 | $map | depot map. |
- Returns:
- P4_Depot provides a fluent interface.
- Exceptions:
-
InvalidArgumentException | map 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 | $owner | a string containing username. |
- Returns:
- P4_Depot provides a fluent interface.
- Exceptions:
-
InvalidArgumentException | owner 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 | $suffix | suffix to be used for generated paths. |
- Returns:
- P4_Depot provides a fluent interface.
- Exceptions:
-
InvalidArgumentException | suffix 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 | $type | type of this depot. |
- Returns:
- P4_Depot provides a fluent interface.
- Exceptions:
-
InvalidArgumentException | description 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] |
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] |
The documentation for this class was generated from the following file: