Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96108144
PhageAction.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, Dec 22, 16:27
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Dec 24, 16:27 (2 d)
Engine
blob
Format
Raw Data
Handle
23106069
Attached To
rPHU libphutil
PhageAction.php
View Options
<?php
abstract
class
PhageAction
extends
Phobject
{
private
$actions
=
array
();
abstract
public
function
isContainerAction
();
protected
function
willAddAction
(
PhageAction
$action
)
{
throw
new
PhutilMethodNotImplementedException
();
}
final
protected
function
getActions
()
{
$this
->
requireContainerAction
();
return
$this
->
actions
;
}
final
public
function
addAction
(
PhageAction
$action
)
{
$this
->
requireContainerAction
();
$this
->
willAddAction
(
$action
);
$this
->
actions
[]
=
$action
;
}
protected
function
getAllWaitingChannels
()
{
if
(!
$this
->
isContainerAction
())
{
throw
new
PhutilMethodNotImplementedException
();
}
$channels
=
array
();
foreach
(
$this
->
getActions
()
as
$action
)
{
foreach
(
$action
->
getAllWaitingChannels
()
as
$channel
)
{
$channels
[]
=
$channel
;
}
}
return
$channels
;
}
private
function
requireContainerAction
()
{
if
(!
$this
->
isContainerAction
())
{
throw
new
Exception
(
pht
(
'This is not a container action.'
));
}
}
}
Event Timeline
Log In to Comment