Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F27361795
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
;
use
Nasqueron\Notifications\Events\ReportEvent
;
use
Event
;
use
Response
;
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
();
$this
->
listenToReports
();
}
///
/// Properties
///
public
function
attachToGate
(
$gate
,
$door
)
{
$this
->
gate
=
$gate
;
$this
->
door
=
$door
;
}
///
/// Output
///
/**
* Gets a JSON string representation of the current instance
*/
public
function
__toString
()
{
return
json_encode
(
$this
,
JSON_PRETTY_PRINT
);
}
/**
* Renders the report
*
* @return Illuminate\Http\Response
*/
public
function
render
()
{
return
Response
::
json
(
$this
);
}
///
/// Events
///
public
function
listenToReports
()
{
Event
::
listen
(
'Nasqueron
\N
otifications
\E
vents
\R
eportEvent'
,
function
(
ReportEvent
$event
)
{
$this
->
actions
[]
=
$event
->
action
;
}
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 5, 17:11 (14 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3669105
Default Alt Text
ActionsReport.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment