Add icon id to service list #730
This commit is contained in:
parent
4182e44607
commit
3bf350ceaf
2 changed files with 20 additions and 0 deletions
|
|
@ -5,6 +5,8 @@ namespace App\Controller\CustomerAppAPI;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Catalyst\ApiBundle\Component\Response as ApiResponse;
|
use Catalyst\ApiBundle\Component\Response as ApiResponse;
|
||||||
|
|
||||||
|
use App\Entity\Service;
|
||||||
|
|
||||||
class ServiceController extends ApiController
|
class ServiceController extends ApiController
|
||||||
{
|
{
|
||||||
public function listServices(Request $req)
|
public function listServices(Request $req)
|
||||||
|
|
@ -45,6 +47,7 @@ class ServiceController extends ApiController
|
||||||
$services[] = [
|
$services[] = [
|
||||||
'id' => $result->getID(),
|
'id' => $result->getID(),
|
||||||
'name' => $result->getName(),
|
'name' => $result->getName(),
|
||||||
|
'icon' => $result->getIcon(),
|
||||||
// 'partners' => $partners,
|
// 'partners' => $partners,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,12 @@ class Service
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
|
// icon used by service on app
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=80, nullable=true)
|
||||||
|
*/
|
||||||
|
protected $icon;
|
||||||
|
|
||||||
// link to partners with this service
|
// link to partners with this service
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToMany(targetEntity="Partner", mappedBy="services", fetch="EXTRA_LAZY")
|
* @ORM\ManyToMany(targetEntity="Partner", mappedBy="services", fetch="EXTRA_LAZY")
|
||||||
|
|
@ -55,6 +61,17 @@ class Service
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setIcon($icon)
|
||||||
|
{
|
||||||
|
$this->icon = $icon;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIcon()
|
||||||
|
{
|
||||||
|
return $this->icon;
|
||||||
|
}
|
||||||
|
|
||||||
public function addPartner(Partner $partner)
|
public function addPartner(Partner $partner)
|
||||||
{
|
{
|
||||||
$this->partners[$partner->getID()] = $partner;
|
$this->partners[$partner->getID()] = $partner;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue