Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101355396
PholioImageSequenceTransaction.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, Feb 8, 14:59
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Feb 10, 14:59 (2 d)
Engine
blob
Format
Raw Data
Handle
24142706
Attached To
rPH Phabricator
PholioImageSequenceTransaction.php
View Options
<?php
final
class
PholioImageSequenceTransaction
extends
PholioImageTransactionType
{
const
TRANSACTIONTYPE
=
'image-sequence'
;
public
function
generateOldValue
(
$object
)
{
$sequence
=
null
;
$phid
=
null
;
$image
=
$this
->
getImageForXaction
(
$object
);
if
(
$image
)
{
$sequence
=
$image
->
getSequence
();
$phid
=
$image
->
getPHID
();
}
return
array
(
$phid
=>
$sequence
);
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$image
=
$this
->
getImageForXaction
(
$object
);
$value
=
(
int
)
head
(
$this
->
getNewValue
());
$image
->
setSequence
(
$value
);
$image
->
save
();
}
public
function
getTitle
()
{
$new
=
$this
->
getNewValue
();
return
pht
(
'%s updated an image
\'
s (%s) sequence.'
,
$this
->
renderAuthor
(),
$this
->
renderHandleLink
(
key
(
$new
)));
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s updated image sequence of %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
public
function
shouldHide
()
{
// this is boring / silly to surface; changing sequence is NBD
return
true
;
}
public
function
mergeTransactions
(
$object
,
PhabricatorApplicationTransaction
$u
,
PhabricatorApplicationTransaction
$v
)
{
$raw_new_value_u
=
$u
->
getNewValue
();
$raw_new_value_v
=
$v
->
getNewValue
();
$phid_u
=
key
(
$raw_new_value_u
);
$phid_v
=
key
(
$raw_new_value_v
);
if
(
$phid_u
==
$phid_v
)
{
return
$v
;
}
}
}
Event Timeline
Log In to Comment