Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F478234
PhabricatorFactEngine.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
PhabricatorFactEngine.php
View Options
<?php
abstract
class
PhabricatorFactEngine
extends
Phobject
{
private
$factMap
;
private
$viewer
;
final
public
static
function
loadAllEngines
()
{
return
id
(
new
PhutilClassMapQuery
())
->
setAncestorClass
(
__CLASS__
)
->
execute
();
}
/**
* @return array All types of facts known by this FactEngine
*/
abstract
public
function
newFacts
();
/**
* @return bool
*/
abstract
public
function
supportsDatapointsForObject
(
PhabricatorLiskDAO
$object
);
/**
* Add new datapoints (due to a transaction) about an object
*/
abstract
public
function
newDatapointsForObject
(
PhabricatorLiskDAO
$object
);
final
protected
function
getFact
(
$key
)
{
if
(
$this
->
factMap
===
null
)
{
$facts
=
$this
->
newFacts
();
$facts
=
mpull
(
$facts
,
null
,
'getKey'
);
$this
->
factMap
=
$facts
;
}
if
(!
isset
(
$this
->
factMap
[
$key
]))
{
throw
new
Exception
(
pht
(
'Unknown fact ("%s") for engine "%s".'
,
$key
,
get_class
(
$this
)));
}
return
$this
->
factMap
[
$key
];
}
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
public
function
getViewer
()
{
if
(!
$this
->
viewer
)
{
throw
new
PhutilInvalidStateException
(
'setViewer'
);
}
return
$this
->
viewer
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 7, 7:50 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
87775
Default Alt Text
PhabricatorFactEngine.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment