diff --git a/com_oauthserver/administrator/src/Model/AccessTokenModel.php b/com_oauthserver/administrator/src/Model/AccessTokenModel.php index bbe877f..c263682 100644 --- a/com_oauthserver/administrator/src/Model/AccessTokenModel.php +++ b/com_oauthserver/administrator/src/Model/AccessTokenModel.php @@ -43,4 +43,21 @@ class AccessTokenModel extends AdminModel implements RevokedModelInterface return $data; } + + /** + * @param \Webmasterskaya\Component\OauthServer\Administrator\Table\AccessTokenTable $table + * @return void + * @since version + */ + protected function prepareTable($table) + { + if ($table->expiry instanceof \DateTime || $table->expiry instanceof \DateTimeImmutable) { + $table->expiry = $table->expiry->format($table->getDbo()->getDateFormat()); + } + } + + public function getTable($name = 'AccessToken', $prefix = 'Administrator', $options = []) + { + return parent::getTable($name, $prefix, $options); + } } \ No newline at end of file diff --git a/com_oauthserver/administrator/src/Model/RefreshTokenModel.php b/com_oauthserver/administrator/src/Model/RefreshTokenModel.php index ae66ae7..9d5fca8 100644 --- a/com_oauthserver/administrator/src/Model/RefreshTokenModel.php +++ b/com_oauthserver/administrator/src/Model/RefreshTokenModel.php @@ -35,4 +35,21 @@ class RefreshTokenModel extends AdminModel implements RevokedModelInterface return $data; } + + /** + * @param \Webmasterskaya\Component\OauthServer\Administrator\Table\RefreshTokenTable $table + * @return void + * @since version + */ + protected function prepareTable($table) + { + if ($table->expiry instanceof \DateTime || $table->expiry instanceof \DateTimeImmutable) { + $table->expiry = $table->expiry->format($table->getDbo()->getDateFormat()); + } + } + + public function getTable($name = 'RefreshToken', $prefix = 'Administrator', $options = []) + { + return parent::getTable($name, $prefix, $options); + } } \ No newline at end of file