Newscoop\Services\UserAttributeService::removeAttributes PHP Method

removeAttributes() public method

Remove user attributes
public removeAttributes ( User $user, array $attributes ) : void
$user Newscoop\Entity\User
$attributes array
return void
    public function removeAttributes(User $user, array $attributes)
    {
        foreach ($attributes as $attribute) {
            if ($entity = $user->removeAttribute($attribute)) {
                $this->em->remove($entity);
            }
        }
        $this->em->flush();
    }