diff -r 806e57d67020 -r e54dfe4d0b2b vendor/bundles/FOS/UserBundle/Model/UserManagerInterface.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/bundles/FOS/UserBundle/Model/UserManagerInterface.php Fri Sep 30 11:24:53 2011 +0200 @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FOS\UserBundle\Model; + +use Symfony\Component\Validator\Constraint; + +/** + * Interface to be implemented by user managers. This adds an additional level + * of abstraction between your application, and the actual repository. + * + * All changes to users should happen through this interface. + * + * The class also contains ACL annotations which will only work if you have the + * SecurityExtraBundle installed, otherwise they will simply be ignored. + * + * @author Gordon Franke + * @author Thibault Duplessis + * @author Johannes M. Schmitt + */ +interface UserManagerInterface +{ + /** + * Creates an empty user instance. + * + * @return UserInterface + */ + function createUser(); + + /** + * Deletes a user. + * + * @param UserInterface $user + */ + function deleteUser(UserInterface $user); + + /** + * Finds one user by the given criteria. + * + * @param array $criteria + * @return UserInterface + */ + function findUserBy(array $criteria); + + /** + * Find a user by its username. + * + * @param string $username + * @return UserInterface or null if user does not exist + */ + function findUserByUsername($username); + + /** + * Finds a user by its email. + * + * @param string $email + * @return UserInterface or null if user does not exist + */ + function findUserByEmail($email); + + /** + * Finds a user by its username or email. + * + * @param string $usernameOrEmail + * @return UserInterface or null if user does not exist + */ + function findUserByUsernameOrEmail($usernameOrEmail); + + /** + * Finds a user by its confirmationToken. + * + * @param string $token + * @return UserInterface or null if user does not exist + */ + function findUserByConfirmationToken($token); + + /** + * Returns a collection with all user instances. + * + * @return \Traversable + */ + function findUsers(); + + /** + * Returns the user's fully qualified class name. + * + * @return string + */ + function getClass(); + + /** + * Reloads a user. + * + * @param UserInterface $user + */ + function reloadUser(UserInterface $user); + + /** + * Updates a user. + * + * @param UserInterface $user + */ + function updateUser(UserInterface $user); + + /** + * Updates the canonical username and email fields for a user. + * + * @param UserInterface $user + */ + function updateCanonicalFields(UserInterface $user); + + /** + * Updates a user password if a plain password is set. + * + * @param UserInterface $user + */ + function updatePassword(UserInterface $user); + + /** + * Checks the uniqueness of the given fields, returns true if its unique. + * + * @param UserInterface $value + * @param Constraint $constraint + * @return Boolean + */ + function validateUnique(UserInterface $value, Constraint $constraint); +}