php - Symfony2 - Using yml for FOSOAuthServerBundle -


I am trying to create a web service using symfony2 in the FOSOAuthServer bundle.

I am using yml configuration; So I create an entity for AcccessToken like this:

yml:

  My ApiBundle \ Entity \ AccessToken: Type: Entity Table: Access_token id: id: Type: Integer Generator: Strategy: Auto: Many: One: Customer: Target Entry: Client Inverse: Includes Access_tokens: Column: Name: client_id referenced columnname: id tap value: false user: target intersection: user is reversed: access_tokens joinColumn: name: user_id referenced Columnname: id   

entity:

   Return Customers; } / ** * Set user * * @ Ultimate \ MyEpi bundle \ unit \ user $ user @Arton AccessToken * / Public Function Set User (\ My \ ApiBundle \ Entity \ User $ user = null) {$ this - & gt; User = $ user; $ This return; } / ** * Get the user * * @ Return * MyEipibundle \ unit \ user * / public function getUser () {Return $ this- & gt; the user; }}   

Now when I run the commands of institutions again, it throws an error.

Fatal error: My \ ApiBundle \ Entity \ AccessToken declaration:: setUser () to FOS \ OAuthServerBundle \ Model \ TokenInterface :: setUser (Symfony \ Component \ Security \ Core \ User \ UserInterface $ User) should be compatible with D: \ xampp \ htdocs \ oauth \ src \ My \ ApiBundle \ Entity \ AccessToken.php on line 12

What am I doing wrong? I'm following the following from Docs.

You can not set user defined method definition (defined in the interface). This must be exactly like token interface.

Change:

  Public function set user (\ My \ ApiBundle \ Entity \ user $ user = null)   

To:

  The public function set user (\ Symfony \ Component \ Security \ Core \ User \ User Interface $ user = null)    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -