-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
229 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Domain\Event; | ||
|
||
use App\Entity\Album; | ||
use Sulu\Bundle\ActivityBundle\Domain\Event\DomainEvent; | ||
|
||
class AlbumCreatedEvent extends DomainEvent | ||
{ | ||
private Album $album; | ||
|
||
/** | ||
* @var mixed[] | ||
*/ | ||
private array $payload; | ||
|
||
/** | ||
* @param mixed[] $payload | ||
*/ | ||
public function __construct(Album $album, array $payload) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->album = $album; | ||
$this->payload = $payload; | ||
} | ||
|
||
public function getAlbum(): Album | ||
{ | ||
return $this->album; | ||
} | ||
|
||
public function getEventPayload(): ?array | ||
{ | ||
return $this->payload; | ||
} | ||
|
||
public function getEventType(): string | ||
{ | ||
return 'created'; | ||
} | ||
|
||
public function getResourceKey(): string | ||
{ | ||
return Album::RESOURCE_KEY; | ||
} | ||
|
||
public function getResourceId(): string | ||
{ | ||
return (string) $this->album->getId(); | ||
} | ||
|
||
public function getResourceTitle(): ?string | ||
{ | ||
return $this->album->getTitle(); | ||
} | ||
|
||
public function getResourceSecurityContext(): ?string | ||
{ | ||
return Album::SECURITY_CONTEXT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Domain\Event; | ||
|
||
use App\Entity\Album; | ||
use Sulu\Bundle\ActivityBundle\Domain\Event\DomainEvent; | ||
|
||
class AlbumModifiedEvent extends DomainEvent | ||
{ | ||
private Album $album; | ||
|
||
/** | ||
* @var mixed[] | ||
*/ | ||
private array $payload; | ||
|
||
/** | ||
* @param mixed[] $payload | ||
*/ | ||
public function __construct(Album $album, array $payload) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->album = $album; | ||
$this->payload = $payload; | ||
} | ||
|
||
public function getAlbum(): Album | ||
{ | ||
return $this->album; | ||
} | ||
|
||
public function getEventPayload(): ?array | ||
{ | ||
return $this->payload; | ||
} | ||
|
||
public function getEventType(): string | ||
{ | ||
return 'modified'; | ||
} | ||
|
||
public function getResourceKey(): string | ||
{ | ||
return Album::RESOURCE_KEY; | ||
} | ||
|
||
public function getResourceId(): string | ||
{ | ||
return (string) $this->album->getId(); | ||
} | ||
|
||
public function getResourceTitle(): ?string | ||
{ | ||
return $this->album->getTitle(); | ||
} | ||
|
||
public function getResourceSecurityContext(): ?string | ||
{ | ||
return Album::SECURITY_CONTEXT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Domain\Event; | ||
|
||
use App\Entity\Album; | ||
use Sulu\Bundle\ActivityBundle\Domain\Event\DomainEvent; | ||
|
||
class AlbumRemovedEvent extends DomainEvent | ||
{ | ||
private int $id; | ||
private string $title; | ||
|
||
public function __construct(int $id, string $title) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->id = $id; | ||
$this->title = $title; | ||
} | ||
|
||
public function getEventType(): string | ||
{ | ||
return 'removed'; | ||
} | ||
|
||
public function getResourceKey(): string | ||
{ | ||
return Album::RESOURCE_KEY; | ||
} | ||
|
||
public function getResourceId(): string | ||
{ | ||
return (string) $this->id; | ||
} | ||
|
||
public function getResourceTitle(): ?string | ||
{ | ||
return $this->title; | ||
} | ||
|
||
public function getResourceSecurityContext(): ?string | ||
{ | ||
return Album::SECURITY_CONTEXT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters