From ee32248f43baef7e995c9e420cd00a137e626cf0 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 8 Oct 2016 00:02:22 +0200 Subject: Ensure access_token are removed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we remove the client, we should ensure that access_token are also removed. To ensure that, I created a test that generated an access_token. So when we remove the client, this association should be cascaded and shouldn’t generate an error. Also I moved some Api related stuff to the ApiBundle (like the developer controler and ClientType form) --- src/Wallabag/ApiBundle/Entity/Client.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Wallabag/ApiBundle/Entity') diff --git a/src/Wallabag/ApiBundle/Entity/Client.php b/src/Wallabag/ApiBundle/Entity/Client.php index 92b2f762..f7898ac8 100644 --- a/src/Wallabag/ApiBundle/Entity/Client.php +++ b/src/Wallabag/ApiBundle/Entity/Client.php @@ -30,6 +30,11 @@ class Client extends BaseClient */ protected $refreshTokens; + /** + * @ORM\OneToMany(targetEntity="AccessToken", mappedBy="client", cascade={"remove"}) + */ + protected $accessTokens; + public function __construct() { parent::__construct(); -- cgit v1.2.3