Created
March 22, 2011 19:42
-
-
Save caefer/881892 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace MyProject\MyBundle\Entity; | |
| use FOS\UserBundle\Entity\User as BaseUser; | |
| /** | |
| * @orm:Entity | |
| */ | |
| class User extends BaseUser | |
| { | |
| /** | |
| * @orm:Id | |
| * @orm:Column(type="integer") | |
| * @orm:generatedValue(strategy="AUTO") | |
| */ | |
| protected $id; | |
| /** | |
| * @orm:Column(type="string") | |
| */ | |
| protected $facebookID; | |
| /** | |
| * @orm:Column(type="array") | |
| */ | |
| protected $FBData; | |
| /** | |
| * Get id | |
| * | |
| * @return integer $id | |
| */ | |
| public function getId() | |
| { | |
| return $this->id; | |
| } | |
| /** | |
| * Set facebookID | |
| * | |
| * @param string $facebookID | |
| */ | |
| public function setFacebookID($facebookID) | |
| { | |
| $this->facebookID = $facebookID; | |
| } | |
| /** | |
| * Get facebookID | |
| * | |
| * @return string $facebookID | |
| */ | |
| public function getFacebookID() | |
| { | |
| return $this->facebookID; | |
| } | |
| /** | |
| * Set FBData | |
| * | |
| * @param array $fBData | |
| */ | |
| public function setFBData($fBData) | |
| { | |
| $this->salt = $fBData['id']; | |
| $this->setFacebookID($fBData['id']); | |
| $this->setLocked(false); | |
| $this->setExpired(false); | |
| $this->setCredentialsExpired(false); | |
| $this->setUsername($fBData['id']); | |
| $this->setEmail($fBData['id'].'@facebook.com'); | |
| // add facebook specific role to use with access control | |
| $this->addRole('ROLE_FACEBOOK'); | |
| $this->FBData = $fBData; | |
| } | |
| /** | |
| * Get FBData | |
| * | |
| * @return array $fBData | |
| */ | |
| public function getFBData() | |
| { | |
| return $this->FBData; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment