Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add user property to odm example code #401

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 12 additions & 20 deletions Resources/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,20 +359,15 @@ namespace Acme\ApiBundle\Document;
use FOS\OAuthServerBundle\Document\AccessToken as BaseAccessToken;
use FOS\OAuthServerBundle\Model\ClientInterface;

/**
* @method User getUser()
* @method Client getClient()
*/
class AccessToken extends BaseAccessToken
{
protected $id;
protected $client;

public function getClient()
{
return $this->client;
}

public function setClient(ClientInterface $client)
{
$this->client = $client;
}
protected $user;
}
```

Expand All @@ -387,6 +382,7 @@ class AccessToken extends BaseAccessToken
<document name="Acme\ApiBundle\Document\AccessToken" db="acme" collection="oauthAccessToken" customId="true">
<field fieldName="id" id="true" strategy="AUTO" />
<reference-one target-document="Acme\ApiBundle\Document\Client" field="client" />
<reference-one target-document="Acme\ApiBundle\Document\User" field="user" />
</document>

</doctrine-mongo-mapping>
Expand All @@ -402,20 +398,15 @@ namespace Acme\ApiBundle\Document;
use FOS\OAuthServerBundle\Document\RefreshToken as BaseRefreshToken;
use FOS\OAuthServerBundle\Model\ClientInterface;

/**
* @method User getUser()
* @method Client getClient()
*/
class RefreshToken extends BaseRefreshToken
{
protected $id;
protected $client;

public function getClient()
{
return $this->client;
}

public function setClient(ClientInterface $client)
{
$this->client = $client;
}
protected $user;
}
```

Expand All @@ -430,6 +421,7 @@ class RefreshToken extends BaseRefreshToken
<document name="Acme\ApiBundle\Document\RefreshToken" db="acme" collection="oauthRefreshToken" customId="true">
<field fieldName="id" id="true" strategy="AUTO" />
<reference-one target-document="Acme\ApiBundle\Document\Client" field="client" />
<reference-one target-document="Acme\ApiBundle\Document\User" field="user" />
</document>

</doctrine-mongo-mapping>
Expand Down