Add icon id to service list #730

This commit is contained in:
Ramon Gutierrez 2023-04-28 17:47:58 +08:00
parent 4182e44607
commit 3bf350ceaf
2 changed files with 20 additions and 0 deletions

View file

@ -5,6 +5,8 @@ namespace App\Controller\CustomerAppAPI;
use Symfony\Component\HttpFoundation\Request;
use Catalyst\ApiBundle\Component\Response as ApiResponse;
use App\Entity\Service;
class ServiceController extends ApiController
{
public function listServices(Request $req)
@ -45,6 +47,7 @@ class ServiceController extends ApiController
$services[] = [
'id' => $result->getID(),
'name' => $result->getName(),
'icon' => $result->getIcon(),
// 'partners' => $partners,
];
}

View file

@ -28,6 +28,12 @@ class Service
*/
protected $name;
// icon used by service on app
/**
* @ORM\Column(type="string", length=80, nullable=true)
*/
protected $icon;
// link to partners with this service
/**
* @ORM\ManyToMany(targetEntity="Partner", mappedBy="services", fetch="EXTRA_LAZY")
@ -55,6 +61,17 @@ class Service
return $this->name;
}
public function setIcon($icon)
{
$this->icon = $icon;
return $this;
}
public function getIcon()
{
return $this->icon;
}
public function addPartner(Partner $partner)
{
$this->partners[$partner->getID()] = $partner;