Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65546309
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
Tue, Jun 4, 14:13
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jun 6, 14:13 (2 d)
Engine
blob
Format
Raw Data
Handle
18091796
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