Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F531841
PhabricatorFactChart.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
PhabricatorFactChart.php
View Options
<?php
final
class
PhabricatorFactChart
extends
PhabricatorFactDAO
implements
PhabricatorPolicyInterface
{
protected
$chartKey
;
protected
$chartParameters
=
array
();
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_SERIALIZATION
=>
array
(
'chartParameters'
=>
self
::
SERIALIZATION_JSON
,
),
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'chartKey'
=>
'bytes12'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'key_chart'
=>
array
(
'columns'
=>
array
(
'chartKey'
),
'unique'
=>
true
,
),
),
)
+
parent
::
getConfiguration
();
}
public
function
setChartParameter
(
$key
,
$value
)
{
$this
->
chartParameters
[
$key
]
=
$value
;
return
$this
;
}
public
function
getChartParameter
(
$key
,
$default
=
null
)
{
return
idx
(
$this
->
chartParameters
,
$key
,
$default
);
}
public
function
save
()
{
if
(
$this
->
getID
())
{
throw
new
Exception
(
pht
(
'Chart configurations are not mutable. You can not update or '
.
'overwrite an existing chart configuration.'
));
}
$digest
=
serialize
(
$this
->
chartParameters
);
$digest
=
PhabricatorHash
::
digestForIndex
(
$digest
);
$this
->
chartKey
=
$digest
;
return
parent
::
save
();
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
);
}
public
function
getPolicy
(
$capability
)
{
return
PhabricatorPolicies
::
getMostOpenPolicy
();
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
false
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 4:10 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
117843
Default Alt Text
PhabricatorFactChart.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment