Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79886485
PhabricatorRepositoryBranch.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
Wed, Aug 28, 19:31
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Aug 30, 19:31 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20207003
Attached To
rPH Phabricator
PhabricatorRepositoryBranch.php
View Options
<?php
final
class
PhabricatorRepositoryBranch
extends
PhabricatorRepositoryDAO
{
protected
$repositoryID
;
protected
$name
;
protected
$lintCommit
;
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'name'
=>
'text128'
,
'lintCommit'
=>
'text40?'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'repositoryID'
=>
array
(
'columns'
=>
array
(
'repositoryID'
,
'name'
),
'unique'
=>
true
,
),
),
)
+
parent
::
getConfiguration
();
}
public
static
function
loadBranch
(
$repository_id
,
$branch_name
)
{
return
id
(
new
PhabricatorRepositoryBranch
())->
loadOneWhere
(
'repositoryID = %d AND name = %s'
,
$repository_id
,
$branch_name
);
}
public
static
function
loadOrCreateBranch
(
$repository_id
,
$branch_name
)
{
$branch
=
self
::
loadBranch
(
$repository_id
,
$branch_name
);
if
(
$branch
)
{
return
$branch
;
}
return
id
(
new
PhabricatorRepositoryBranch
())
->
setRepositoryID
(
$repository_id
)
->
setName
(
$branch_name
)
->
save
();
}
}
Event Timeline
Log In to Comment