-
Notifications
You must be signed in to change notification settings - Fork 100
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 #959 from cakephp/enum-entity-annotation
Fix annotation for entity field mapped to enum type.
- Loading branch information
Showing
6 changed files
with
79 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,23 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Bake\Test\App\Model\Entity; | ||
|
||
use Cake\ORM\Entity; | ||
|
||
/** | ||
* Article Entity | ||
* | ||
* @property int $id | ||
* @property int|null $author_id | ||
* @property string|null $title | ||
* @property string|null $body | ||
* @property \Bake\Test\App\Model\Enum\ArticleStatus|null $published | ||
* | ||
* @property \Bake\Test\App\Model\Entity\Author $author | ||
* @property \Bake\Test\App\Model\Entity\Tag[] $tags | ||
* @property \Bake\Test\App\Model\Entity\ArticlesTag[] $articles_tags | ||
*/ | ||
class Article extends Entity | ||
{ | ||
} |
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,21 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org) | ||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice | ||
* | ||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) | ||
* @since 3.0.4 | ||
* @license https://opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
namespace Bake\Test\App\Model\Enum; | ||
|
||
enum ArticleStatus: string | ||
{ | ||
case PUBLISHED = 'Y'; | ||
case UNPUBLISHED = 'N'; | ||
} |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
<?php | ||
|
||
return [ | ||
'SimpleExample' => [], | ||
'Simple' => [], | ||
'Company/Example' => [], | ||
'ComposerExample' => [] | ||
]; | ||
'ComposerExample' => [], | ||
]; |