private static function insert(Gallery $model)
 {
     $db = Database::getInstance('app');
     $query = "INSERT INTO gallery (source,carousel,title,description,post_date,titleBG,descriptionBG) VALUES (:source, :carousel, :title, :description, :post_date, :titleBG, :descriptionBG);";
     $result = $db->prepare($query);
     $result->execute([':source' => $model->getSource(), ':carousel' => $model->getCarousel(), ':title' => $model->getTitle(), ':description' => $model->getDescription(), ':post_date' => $model->getPost_date(), ':titleBG' => $model->getTitleBG(), ':descriptionBG' => $model->getDescriptionBG()]);
     $model->setId($db->lastId());
 }
 /**
  * Creates gallery and saves it to database.
  * @param Gallery $gallery
  */
 public static function addGallery(Gallery $gallery)
 {
     $db = Database::getInstance();
     $query = $db->prepare('INSERT INTO gallery (userid,title,tag,created) VALUES (?, ?, ?, ?)');
     $query->execute([$gallery->getUserID(), $gallery->getTitle(), $gallery->getTag(), $gallery->getCreated()]);
 }