add new demo symfony files
This commit is contained in:
30
app/src/Event/CommentCreatedEvent.php
Normal file
30
app/src/Event/CommentCreatedEvent.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Event;
|
||||
|
||||
use App\Entity\Comment;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
class CommentCreatedEvent extends Event
|
||||
{
|
||||
protected $comment;
|
||||
|
||||
public function __construct(Comment $comment)
|
||||
{
|
||||
$this->comment = $comment;
|
||||
}
|
||||
|
||||
public function getComment(): Comment
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user