Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98087654
DiffusionBranchInformation.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jan 9, 15:52
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Jan 11, 15:52 (2 d)
Engine
blob
Format
Raw Data
Handle
23503310
Attached To
rPH Phabricator
DiffusionBranchInformation.php
View Options
<?php
final
class
DiffusionBranchInformation
{
const
DEFAULT_GIT_REMOTE
=
'origin'
;
private
$name
;
private
$headCommitIdentifier
;
public
function
setName
(
$name
)
{
$this
->
name
=
$name
;
return
$this
;
}
public
function
getName
()
{
return
$this
->
name
;
}
public
function
setHeadCommitIdentifier
(
$head_commit_identifier
)
{
$this
->
headCommitIdentifier
=
$head_commit_identifier
;
return
$this
;
}
public
function
getHeadCommitIdentifier
()
{
return
$this
->
headCommitIdentifier
;
}
public
static
function
newFromConduit
(
array
$dicts
)
{
$branches
=
array
();
foreach
(
$dicts
as
$dict
)
{
$branches
[]
=
id
(
new
DiffusionBranchInformation
())
->
setName
(
$dict
[
'name'
])
->
setHeadCommitIdentifier
(
$dict
[
'headCommitIdentifier'
]);
}
return
$branches
;
}
public
function
toDictionary
()
{
return
array
(
'name'
=>
$this
->
getName
(),
'headCommitIdentifier'
=>
$this
->
getHeadCommitIdentifier
()
);
}
// TODO: These are hacks to make this compatible with DiffusionRepositoryRef
// for PhabricatorRepositoryRefEngine. The two classes should be merged.
public
function
getShortName
()
{
return
$this
->
getName
();
}
public
function
getCommitIdentifier
()
{
return
$this
->
getHeadCommitIdentifier
();
}
}
Event Timeline
Log In to Comment