From 78010453121b805d1bfbe2d9bffda490d76fcaba Mon Sep 17 00:00:00 2001 From: Mark Scherer Date: Tue, 19 Nov 2024 02:29:13 +0100 Subject: [PATCH] Dont return method call on void. --- en/orm/database-basics.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/en/orm/database-basics.rst b/en/orm/database-basics.rst index 380f7ada41..d5639e5c85 100644 --- a/en/orm/database-basics.rst +++ b/en/orm/database-basics.rst @@ -476,12 +476,14 @@ Enum Type Maps a `BackedEnum `_ to a string or integer column. To use this type you need to specify which column is associated to which BackedEnum inside the table class:: - use \Cake\Database\Type\EnumType; - use \App\Model\Enum\ArticleStatus; + use App\Model\Enum\ArticleStatus; + use Cake\Database\Type\EnumType; // in src/Model/Table/ArticlesTable.php public function initialize(array $config): void { + parent::initialize($config); + $this->getSchema()->setColumnType('status', EnumType::from(ArticleStatus::class)); } @@ -608,7 +610,7 @@ following:: { parent::initialize($config); - return $this->getSchema()->setColumnType('widget_prefs', 'json'); + $this->getSchema()->setColumnType('widget_prefs', 'json'); } }