Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F429839
PholioImageSequenceTransaction.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
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
->
renderHandle
(
head_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
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 3, 9:10 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
59342
Default Alt Text
PholioImageSequenceTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment