Remove attribute
public removeAttribute ( string $name ) : Newscoop\Entity\UserAttribute | ||
$name | string | |
return | Newscoop\Entity\UserAttribute |
/** * Remove user attributes * * @param Newscoop\Entity\User $user * @param array $attributes * * @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(); }