Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106133026
PhortunePaymentMethod.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
Sat, Mar 22, 22:45
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Mar 24, 22:45 (2 d)
Engine
blob
Format
Raw Data
Handle
25105567
Attached To
rPH Phabricator
PhortunePaymentMethod.php
View Options
<?php
/**
* A payment method is a credit card; it is associated with an account and
* charges can be made against it.
*/
final
class
PhortunePaymentMethod
extends
PhortuneDAO
implements
PhabricatorPolicyInterface
{
protected
$name
;
protected
$accountPHID
;
protected
$authorPHID
;
protected
$metadata
;
private
$account
;
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
self
::
CONFIG_SERIALIZATION
=>
array
(
'metadata'
=>
self
::
SERIALIZATION_JSON
,
),
)
+
parent
::
getConfiguration
();
}
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
PhabricatorPHIDConstants
::
PHID_TYPE_PAYM
);
}
public
function
attachAccount
(
PhortuneAccount
$account
)
{
$this
->
account
=
$account
;
return
$this
;
}
public
function
getAccount
()
{
if
(!
$this
->
account
)
{
throw
new
Exception
(
"Call attachAccount() before getAccount()!"
);
}
return
$this
->
account
;
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
);
}
public
function
getPolicy
(
$capability
)
{
return
$this
->
getAccount
()->
getPolicy
(
$capability
);
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
$this
->
getAccount
()->
hasAutomaticCapability
(
$capability
,
$viewer
);
}
}
Event Timeline
Log In to Comment