/** * Turn this item object into a generic array * * @return array */ public function transform(Product $product) { return ['id' => $product->id, 'name' => $product->getName(), 'price' => $product->getPrice(), 'category' => $product->getCategory()]; }
private function renderProduct(Product $p, $isNew = false) { $name = $p->getName() . ($isNew ? ' [NUOVO]' : ''); return $name . ' - € ' . $p->getPrice() . ' - ' . $p->getCategory(); }