Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F476881
ManiphestTaskProject.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ManiphestTaskProject.php
View Options
<?php
/**
* This is a DAO for the Task -> Project table, which denormalizes the
* relationship between tasks and projects into a link table so it can be
* efficiently queried. This table is not authoritative; the projectPHIDs field
* of ManiphestTask is. The rows in this table are regenerated when transactions
* are applied to tasks which affected their associated projects.
*/
final
class
ManiphestTaskProject
extends
ManiphestDAO
{
protected
$taskPHID
;
protected
$projectPHID
;
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_IDS
=>
self
::
IDS_MANUAL
,
self
::
CONFIG_TIMESTAMPS
=>
false
,
);
}
public
static
function
updateTaskProjects
(
ManiphestTask
$task
,
array
$new_phids
)
{
$edge_type
=
PhabricatorProjectObjectHasProjectEdgeType
::
EDGECONST
;
$old_phids
=
PhabricatorEdgeQuery
::
loadDestinationPHIDs
(
$task
->
getPHID
(),
$edge_type
);
$add_phids
=
array_diff
(
$new_phids
,
$old_phids
);
$rem_phids
=
array_diff
(
$old_phids
,
$new_phids
);
if
(!
$add_phids
&&
!
$rem_phids
)
{
return
;
}
$editor
=
new
PhabricatorEdgeEditor
();
foreach
(
$add_phids
as
$phid
)
{
$editor
->
addEdge
(
$task
->
getPHID
(),
$edge_type
,
$phid
);
}
foreach
(
$rem_phids
as
$phid
)
{
$editor
->
remEdge
(
$task
->
getPHID
(),
$edge_type
,
$phid
);
}
$editor
->
save
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 7, 6:00 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
86725
Default Alt Text
ManiphestTaskProject.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment