Created APiKeyService and tests

This commit is contained in:
Alejandro Celaya
2016-08-06 13:18:27 +02:00
parent 2767a14101
commit 7b746f76b0
5 changed files with 273 additions and 3 deletions

View File

@@ -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
*