From 58a6631164ce3d5e84104ab36458e867564a5922 Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Wed, 6 Mar 2024 12:52:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20ge?= =?UTF-8?q?tItemByIdentifier=20=D0=B2=20ClientModel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../administrator/src/Model/ClientModel.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/com_oauthserver/administrator/src/Model/ClientModel.php b/com_oauthserver/administrator/src/Model/ClientModel.php index 6587258..9c2f05c 100644 --- a/com_oauthserver/administrator/src/Model/ClientModel.php +++ b/com_oauthserver/administrator/src/Model/ClientModel.php @@ -9,6 +9,8 @@ use Joomla\CMS\MVC\Model\AdminModel; class ClientModel extends AdminModel { + use GetItemByIdentifierTrait; + /** * The type alias for this content type. * @@ -17,15 +19,6 @@ class ClientModel extends AdminModel */ public $typeAlias = 'com_oauthserver.client'; - /** - * Client item. - * - * @var array|null - * - * @since 1.0.0 - */ - protected ?array $_item = null; - /** * @param array $data * @param bool $loadData @@ -87,10 +80,10 @@ class ClientModel extends AdminModel if ($task === 'save2reset' || empty($table->id)) { $table->identifier = $this->generateNewIdentifier(); - $table->secret = $table->public ? '' : $this->generateNewSecret(); + $table->secret = !!$table->public ? '' : $this->generateNewSecret(); } - if ($table->public) { + if (!!$table->public) { $table->secret = ''; } else { if (empty($table->secret)) {