Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4793814
ActionsReport.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ActionsReport.php
View Options
<?php
namespace
Nasqueron\Notifications\Actions
;
class
ActionsReport
{
/**
* List of actions
*
* @var Action[]
*/
public
$actions
=
[];
/**
* Report created date
*
* @var int
*/
public
$created
;
/**
* The entry gate
*
* @var string
*/
public
$gate
;
/**
* The entry door
*
* @var string
*/
public
$door
;
/**
* Initializes a new instance of an actions report
*/
public
function
__construct
()
{
$this
->
created
=
time
();
}
///
/// Properties
///
/**
* Sets the gate and the door for this report
*
* @param string $gate The gate
* @param string $door The door
*/
public
function
attachToGate
(
string
$gate
,
string
$door
)
:
void
{
$this
->
gate
=
$gate
;
$this
->
door
=
$door
;
}
/**
* Adds an action to the list of actions to report
*
* @param Action $action The action to add
*/
public
function
addAction
(
Action
$action
)
:
void
{
$this
->
actions
[]
=
$action
;
}
/**
* Determines if one of the action has failed.
*
* @return bool
*/
public
function
containsError
()
:
bool
{
foreach
(
$this
->
actions
as
$action
)
{
if
(
$action
->
error
!==
null
)
{
return
true
;
}
}
return
false
;
}
///
/// Output
///
/**
* Gets a JSON string representation of the current instance
*/
public
function
__toString
()
:
string
{
return
json_encode
(
$this
,
JSON_PRETTY_PRINT
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Feb 28, 22:47 (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2436608
Default Alt Text
ActionsReport.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment