forked from andersao/l5-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional events (andersao#709)
* Add additional events Signed-off-by: Lloric Mayuga Garcia <[email protected]> * docs Signed-off-by: Lloric Mayuga Garcia <[email protected]>
- Loading branch information
Showing
5 changed files
with
72 additions
and
2 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
26 changes: 26 additions & 0 deletions
26
src/Prettus/Repository/Events/RepositoryEntityCreating.php
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,26 @@ | ||
<?php | ||
|
||
namespace Prettus\Repository\Events; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Prettus\Repository\Contracts\RepositoryInterface; | ||
|
||
/** | ||
* Class RepositoryEntityCreated | ||
* | ||
* @package Prettus\Repository\Events | ||
* @author Anderson Andrade <[email protected]> | ||
*/ | ||
class RepositoryEntityCreating extends RepositoryEventBase | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $action = "creating"; | ||
|
||
public function __construct(RepositoryInterface $repository, array $model) | ||
{ | ||
parent::__construct($repository); | ||
$this->model = $model; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Prettus/Repository/Events/RepositoryEntityDeleting.php
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,15 @@ | ||
<?php | ||
namespace Prettus\Repository\Events; | ||
|
||
/** | ||
* Class RepositoryEntityDeleted | ||
* @package Prettus\Repository\Events | ||
* @author Anderson Andrade <[email protected]> | ||
*/ | ||
class RepositoryEntityDeleting extends RepositoryEventBase | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $action = "deleting"; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Prettus/Repository/Events/RepositoryEntityUpdating.php
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,15 @@ | ||
<?php | ||
namespace Prettus\Repository\Events; | ||
|
||
/** | ||
* Class RepositoryEntityUpdated | ||
* @package Prettus\Repository\Events | ||
* @author Anderson Andrade <[email protected]> | ||
*/ | ||
class RepositoryEntityUpdating extends RepositoryEventBase | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $action = "updating"; | ||
} |
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