public function cleanUpUnassignedTokens(array $tokens)
    {
        $this->em->clear();
        foreach ($tokens as $token) {
            $token = $this->em->merge($token);
            $this->em->remove($token);
        }

        $this->em->flush();
    }
public function cleanUpUnassignedTokens(array $tokens)
    {
        $this->em->clear();
        foreach ($tokens as $token) {
            $token = $this->em->merge($token);
            $this->em->remove($token);
        }

        $this->em->flush();
    }
public function cleanUpUnassignedTokens ( array $ tokens ) { $ this -> em -> clear ( ) ; foreach ( $ tokens as $ token ) { $ token = $ this -> em -> merge ( $ token ) ; $ this -> em -> remove ( $ token ) ; } $ this -> em -> flush ( ) ; }
Removes the not assigned tokens.

@param Token[] $tokens
Removes the not assigned tokens .