66 lines
1.2 KiB
PHP
66 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Catalyst\ApiBundle\Entity\User as BaseUser;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="api_user")
|
|
*/
|
|
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;
|
|
}
|
|
}
|