Skip to content

Commit

Permalink
Return the full entity
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Jun 8, 2016
1 parent d8df5a1 commit 3952eba
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Events/PostWasCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Modules\Blog\Events;

use Modules\Blog\Entities\Post;
use Modules\Media\Contracts\StoringMedia;

class PostWasCreated implements StoringMedia
Expand All @@ -11,14 +12,14 @@ class PostWasCreated implements StoringMedia
*/
public $data;
/**
* @var int
* @var Post
*/
public $postId;
public $post;

public function __construct($postId, array $data)
public function __construct($post, array $data)
{
$this->data = $data;
$this->postId = $postId;
$this->post = $post;
}

/**
Expand All @@ -27,7 +28,7 @@ public function __construct($postId, array $data)
*/
public function getEntity()
{
return $this->postId;
return $this->post;
}

/**
Expand Down

0 comments on commit 3952eba

Please sign in to comment.