Completed
Push — master ( 381b4d...e69b5e )
by Nicolas
02:32
created

PostWasCreated::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Modules\Blog\Events;
4
5
use Modules\Blog\Entities\Post;
6
use Modules\Media\Contracts\StoringMedia;
7
8
class PostWasCreated implements StoringMedia
9
{
10
    /**
11
     * @var array
12
     */
13
    public $data;
14
    /**
15
     * @var Post
16
     */
17
    public $post;
18
19
    public function __construct($post, array $data)
20
    {
21
        $this->data = $data;
22
        $this->post = $post;
23
    }
24
25
    /**
26
     * Return the entity
27
     * @return \Illuminate\Database\Eloquent\Model
28
     */
29
    public function getEntity()
30
    {
31
        return $this->post;
32
    }
33
34
    /**
35
     * Return the ALL data sent
36
     * @return array
37
     */
38
    public function getSubmissionData()
39
    {
40
        return $this->data;
41
    }
42
}
43