Add ApiUser to replace the old catalyst api user #730
This commit is contained in:
parent
efec5c4b84
commit
af39b6d6ca
1 changed files with 61 additions and 0 deletions
61
src/Entity/ApiUser.php
Normal file
61
src/Entity/ApiUser.php
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Catalyst\ApiBundle\Entity\User as BaseUser;
|
||||
|
||||
class ApiUser extends BaseUser;
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
// rider linked to user
|
||||
// NOTE: we're directly linking this only because we don't have to care about other apps using this library
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Rider", mappedBy="api_user")
|
||||
*/
|
||||
protected $rider;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
protected $metadata;
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setMetadata($meta)
|
||||
{
|
||||
$this->metadata = $meta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMetadata()
|
||||
{
|
||||
if ($this->metadata == null)
|
||||
return [];
|
||||
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
public function setRider($rider)
|
||||
{
|
||||
$this->rider = $rider;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRider()
|
||||
{
|
||||
return $this->rider;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue