Add ApiUser to replace the old catalyst api user #730

This commit is contained in:
Kendrick Chan 2023-02-08 02:44:15 +08:00
parent efec5c4b84
commit af39b6d6ca

61
src/Entity/ApiUser.php Normal file
View 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;
}
}