Skip to content

Commit

Permalink
Merge pull request #11 from K-Phoen/mongodb-support
Browse files Browse the repository at this point in the history
Support Doctrine ODM as well as Doctrine ORM
  • Loading branch information
cryptiklemur committed Dec 16, 2014
2 parents f8c1209 + e72e152 commit 42ae0b2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
14 changes: 14 additions & 0 deletions src/Uecode/Bundle/ApiKeyBundle/Document/ApiKeyUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Uecode\Bundle\ApiKeyBundle\Document;

use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
use Uecode\Bundle\ApiKeyBundle\Model\ApiKeyUser as BaseUser;

class ApiKeyUser extends BaseUser
{
/**
* @MongoDB\String
*/
protected $apiKey;
}
18 changes: 18 additions & 0 deletions src/Uecode/Bundle/ApiKeyBundle/Entity/ApiKeyUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Uecode\Bundle\ApiKeyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\MappedSuperclass;
use Uecode\Bundle\ApiKeyBundle\Model\ApiKeyUser as BaseUser;

/**
* @MappedSuperclass
*/
class ApiKeyUser extends BaseUser
{
/**
* @ORM\Column(name="api_key", type="string", length=255, nullable=true)
*/
protected $apiKey;
}
13 changes: 2 additions & 11 deletions src/Uecode/Bundle/ApiKeyBundle/Model/ApiKeyUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@

namespace Uecode\Bundle\ApiKeyBundle\Model;

use Symfony\Component\Security\Core\User\UserInterface as BaseUserInterface;
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\MappedSuperclass;
use FOS\UserBundle\Model\User as BaseUser;
use FOS\UserBundle\Model\UserInterface;
use Symfony\Component\Security\Core\User\UserInterface as BaseUserInterface;
use Symfony\Component\Security\Core\User\AdvancedUserInterface;

/**
* @MappedSuperclass
*/
class ApiKeyUser extends BaseUser implements UserInterface, AdvancedUserInterface, BaseUserInterface
{
/**
* @ORM\Column(name="api_key", type="string", length=255, nullable=true)
*/
protected $apiKey;

public function __construct()
Expand Down

0 comments on commit 42ae0b2

Please sign in to comment.