-
-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for enum in symfony property accessor hydrator
- Loading branch information
1 parent
bb4ed62
commit 9bed799
Showing
4 changed files
with
129 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Alice package. | ||
* | ||
* (c) Nelmio <hello@nelm.io> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Nelmio\Alice\Entity; | ||
|
||
use Nelmio\Alice\Entity\Enum\DummyEnum; | ||
|
||
class DummyWithEnum | ||
{ | ||
private DummyEnum $dummyEnum; | ||
|
||
public function setDummyEnum(DummyEnum $dummyEnum): void | ||
{ | ||
$this->dummyEnum = $dummyEnum; | ||
} | ||
|
||
public function getDummyEnum(): DummyEnum | ||
{ | ||
return $this->dummyEnum; | ||
} | ||
} |
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,20 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Alice package. | ||
* | ||
* (c) Nelmio <hello@nelm.io> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Nelmio\Alice\Entity\Enum; | ||
|
||
enum DummyEnum: string | ||
{ | ||
case Case1 = 'case1'; | ||
case Case2 = 'case2'; | ||
} |
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