/**
  * Saves a category into the database
  *
  * @param \VeryGoodTrip\Domain\Category $category The category to save
  */
 public function save(Category $category)
 {
     $categoryData = array('category_id' => $category->getId(), 'category_name' => $category->getName(), 'category_description' => $category->getDescription(), 'category_image' => $category->getImage());
     if ($category->getId()) {
         $this->getDb()->update('category', $categoryData, array('category_id' => $category->getId()));
     } else {
         $this->getDb()->insert('category', $categoryData);
         // Get the id of the newly created category and set it on the entity.
         $id = $this->getDb()->lastInsertId();
         $category->setId($id);
     }
 }