-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from vtsykun/feat/cust1
Added events hooks to simplify user menu customization
- Loading branch information
Showing
5 changed files
with
104 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Packeton\Event; | ||
|
||
use Knp\Menu\ItemInterface; | ||
use Symfony\Contracts\EventDispatcher\Event; | ||
|
||
class MenuLoadEvent extends Event | ||
{ | ||
public const NAME = 'menuLoad'; | ||
|
||
public function __construct(private readonly ItemInterface $menu, private readonly string $name) | ||
{ | ||
} | ||
|
||
/** | ||
* @return ItemInterface | ||
*/ | ||
public function getMenu(): ItemInterface | ||
{ | ||
return $this->menu; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName(): string | ||
{ | ||
return $this->name; | ||
} | ||
} |
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,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Packeton\Event; | ||
|
||
use Packeton\Entity\Package; | ||
use Symfony\Contracts\EventDispatcher\Event; | ||
|
||
class ZipballEvent extends Event | ||
{ | ||
public const DOWNLOAD = 'zipballDownload'; | ||
|
||
public function __construct( | ||
private Package $package, | ||
private string $reference, | ||
private mixed $dist, | ||
) { | ||
} | ||
|
||
/** | ||
* @return Package | ||
*/ | ||
public function getPackage(): Package | ||
{ | ||
return $this->package; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getReference(): string | ||
{ | ||
return $this->reference; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getDist(): mixed | ||
{ | ||
return $this->dist; | ||
} | ||
|
||
public function setDist(mixed $dist) | ||
{ | ||
$this->dist = $dist; | ||
} | ||
} |
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