Пример #1
0
 public function transform(\Entity\Brand $brand)
 {
     return ['id' => (int) $brand->getBrandId(), 'name' => $brand->getName(), 'links' => ['rel' => 'self', 'uri' => \Util\SlimUtil::absoluteUrlFor('brand_by_id', ['id' => $brand->getBrandId()]), 'method' => 'GET']];
 }
Пример #2
0
 /**
  * 
  * @param \Entity\Brand $brand
  * @return boolean
  */
 public function exists($brand)
 {
     $brands = $this->finByName($brand->getName());
     return count($this->finByName($brand->getName())) > 0;
 }