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)) {