mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 09:13:11 +08:00
Created APiKeyService and tests
This commit is contained in:
@@ -84,7 +84,7 @@ class ApiKey extends AbstractEntity
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->expirationDate >= new \DateTime();
|
||||
return $this->expirationDate < new \DateTime();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,6 +105,16 @@ class ApiKey extends AbstractEntity
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables this API key
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function disable()
|
||||
{
|
||||
return $this->setEnabled(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells if this api key is enabled and not expired
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user