Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100747473
PhortuneCurrencySerializer.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
Sun, Feb 2, 10:18
Size
500 B
Mime Type
text/x-php
Expires
Tue, Feb 4, 10:18 (2 d)
Engine
blob
Format
Raw Data
Handle
24026877
Attached To
rPH Phabricator
PhortuneCurrencySerializer.php
View Options
<?php
final
class
PhortuneCurrencySerializer
extends
PhabricatorLiskSerializer
{
public
function
willReadValue
(
$value
)
{
return
PhortuneCurrency
::
newFromString
(
$value
);
}
public
function
willWriteValue
(
$value
)
{
if
(!(
$value
instanceof
PhortuneCurrency
))
{
throw
new
Exception
(
pht
(
'Trying to save object with a currency column, but the column '
.
'value is not a PhortuneCurrency object.'
));
}
return
$value
->
serializeForStorage
();
}
}
Event Timeline
Log In to Comment