public function transform(\Entity\Area $area) { return ['id' => (int) $area->getAreaId(), 'name' => $area->getName(), 'links' => ['rel' => 'self', 'uri' => \Util\SlimUtil::absoluteUrlFor('area_by_id', ['id' => $area->getAreaId()]), 'method' => 'GET']]; }
/** * * @param \Entity\Area $area */ public function update($area) { $sql = 'UPDATE area SET name=:name WHERE idarea=:id'; $stmt = $this->db->getConnection()->prepare($sql); $stmt->bindParam('name', $area->getName()); $stmt->bindParam('id', $area->getAreaId()); return $stmt->execute(); }