From 4637979ddfe7a24daa94ff4e3b2058fccf1bf369 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 3 Aug 2016 13:08:25 +0200 Subject: [PATCH] Added a help note about the __toString() method in User classes --- security/custom_provider.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/security/custom_provider.rst b/security/custom_provider.rst index 9d16da52f80..819a5ad216e 100644 --- a/security/custom_provider.rst +++ b/security/custom_provider.rst @@ -100,6 +100,13 @@ This is how your ``WebserviceUser`` class looks in action:: return true; } + + // it's recommended to add this method so you can later pass the + // user object to other methods instead of their username + public function __toString() + { + return $this->username; + } } If you have more information about your users - like a "first name" - then