Skip to content

Commit

Permalink
Merge pull request FriendsOfSymfony#16 from Plemi/master
Browse files Browse the repository at this point in the history
Fixes Doctrine mongodb support.
  • Loading branch information
arnaud-lb committed Mar 22, 2012
2 parents 26cbcad + 1bd3db2 commit 3bdef5e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Resources/config/doctrine/AccessToken.mongodb.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">

<mapped-superclass name="FOS\OAuthServerBundle\Document\AccessToken">
<field name="token" fieldName="token" type="string" />
<field name="expiresAt" fieldName="expiresAt" type="int" nullable="true" />
<field name="scope" fieldName="scope" type="string" nullable="true" />
</mapped-superclass>
</doctrine-mongo-mapping>
13 changes: 13 additions & 0 deletions Resources/config/doctrine/AuthCode.mongodb.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">

<mapped-superclass name="FOS\OAuthServerBundle\Document\AuthCode">
<field name="token" fieldName="token" type="string" />
<field name="redirectUri" fieldName="redirectUri" type="text" />
<field name="expiresAt" fieldName="expiresAt" type="int" nullable="true" />
<field name="scope" fieldName="scope" type="string" nullable="true" />
</mapped-superclass>
</doctrine-mongo-mapping>
13 changes: 13 additions & 0 deletions Resources/config/doctrine/Client.mongodb.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">

<mapped-superclass name="FOS\OAuthServerBundle\Document\Client">
<field name="randomId" fieldName="randomId" type="string" />
<field name="redirectUris" fieldName="redirectUris" type="hash" />
<field name="secret" fieldName="secret" type="string" />
<field name="allowedGrantTypes" fieldName="allowedGrantTypes" type="hash" />
</mapped-superclass>
</doctrine-mongo-mapping>
6 changes: 6 additions & 0 deletions Resources/config/odm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<parameters>
<parameter key="fos_oauth_server.model.client.manager.class">FOS\OAuthServerBundle\Document\ClientManager</parameter>
<parameter key="fos_oauth_server.model.access.token.manager.class">FOS\OAuthServerBundle\Document\AccessTokenManager</parameter>
<parameter key="fos_oauth_server.model.auth.code.manager.class">FOS\OAuthServerBundle\Document\AuthCodeManager</parameter>
</parameters>

<services>
Expand All @@ -19,5 +20,10 @@
<argument type="service" id="doctrine.odm.mongodb.document_manager" />
<argument>%fos_oauth_server.model.access.token.class%</argument>
</service>

<service id="fos_oauth_server.auth.code.manager.default" class="%fos_oauth_server.model.auth.code.manager.class%">
<argument type="service" id="doctrine.odm.mongodb.document_manager" />
<argument>%fos_oauth_server.model.auth.code.class%</argument>
</service>
</services>
</container>

0 comments on commit 3bdef5e

Please sign in to comment.