mirror of
https://github.com/bodyrep/bodyrep-sandpit.git
synced 2026-01-27 07:11:37 +00:00
Initial symfony commit
This commit is contained in:
135
sandbox/src/BodyRep/Entity/Member.php
Normal file
135
sandbox/src/BodyRep/Entity/Member.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
namespace BodyRep\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
/**
|
||||
* Bodyrep\Entity\Member
|
||||
*
|
||||
* @ORM\Table(name="member")
|
||||
* @ORM\Entity(repositoryClass="BodyRep\Entity\UserRepository")
|
||||
*/
|
||||
class Member implements UserInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=25, unique=true)
|
||||
*/
|
||||
private $username;
|
||||
|
||||
/**
|
||||
* @var string $fullname
|
||||
*
|
||||
* @ORM\Column(name="fullname", type="string")
|
||||
*/
|
||||
private $fullname;
|
||||
/**
|
||||
* @ORM\Column(type="string", length=32)
|
||||
*/
|
||||
private $salt;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=40)
|
||||
*/
|
||||
private $password;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60, unique=true)
|
||||
*/
|
||||
private $email;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="active", type="integer")
|
||||
*/
|
||||
private $isActive;
|
||||
|
||||
private $roles;
|
||||
|
||||
public function __construct($username, $password = '', $salt = '', $roles = array())
|
||||
{
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
$this->salt = $salt;
|
||||
$this->roles = $roles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getSalt()
|
||||
{
|
||||
return $this->salt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getRoles()
|
||||
{
|
||||
return array('ROLE_USER');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function eraseCredentials()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Set fullName
|
||||
*
|
||||
* @param string $fullname
|
||||
* @return Member
|
||||
*/
|
||||
public function setfullname($fullname)
|
||||
{
|
||||
$this->fullname = $fullname;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fullName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFullName()
|
||||
{
|
||||
return $this->fullname;
|
||||
}
|
||||
/**
|
||||
* Get fullName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLink()
|
||||
{
|
||||
return '/app_dev.php/' . $this->getUsername();
|
||||
}
|
||||
}
|
||||
127
sandbox/src/BodyRep/Entity/Profile.php
Normal file
127
sandbox/src/BodyRep/Entity/Profile.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace BodyRep\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
/**
|
||||
* Bodyrep\Entity\Profile
|
||||
*
|
||||
* @ORM\Table(name="member")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class Profile
|
||||
{
|
||||
/**
|
||||
* @var integer $id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
|
||||
/**
|
||||
* @var string $fullname
|
||||
*
|
||||
* @ORM\Column(name="fullname", type="string")
|
||||
*/
|
||||
private $fullname;
|
||||
|
||||
/**
|
||||
* @var string $username
|
||||
*
|
||||
* @ORM\Column(name="username", type="string")
|
||||
*/
|
||||
private $username;
|
||||
|
||||
/**
|
||||
* @var float $currentweight
|
||||
*
|
||||
* @ORM\Column(name="currentweight", type="float")
|
||||
*/
|
||||
private $currentweight;
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getid()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set fullName
|
||||
*
|
||||
* @param string $fullname
|
||||
* @return Profile
|
||||
*/
|
||||
public function setfullname($fullname)
|
||||
{
|
||||
$this->fullname = $fullname;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fullName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFullName()
|
||||
{
|
||||
return $this->fullname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set userName
|
||||
*
|
||||
* @param string $username
|
||||
* @return Profile
|
||||
*/
|
||||
public function setUserName($username)
|
||||
{
|
||||
$this->username = $userName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get userName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUserName()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set currentWeight
|
||||
*
|
||||
* @param float $currentWeight
|
||||
* @return Profile
|
||||
*/
|
||||
public function setCurrentWeight($currentWeight)
|
||||
{
|
||||
$this->currentweight = $currentWeight;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get currentWeight
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getCurrentWeight()
|
||||
{
|
||||
return $this->currentweight;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user