добавил prepareTable и getTable

This commit is contained in:
Artem Vasilev 2024-03-08 02:19:25 +03:00
parent 6089848c68
commit a4b238e1c4
2 changed files with 34 additions and 0 deletions

View File

@ -43,4 +43,21 @@ class AccessTokenModel extends AdminModel implements RevokedModelInterface
return $data; 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);
}
} }

View File

@ -35,4 +35,21 @@ class RefreshTokenModel extends AdminModel implements RevokedModelInterface
return $data; 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);
}
} }