/**
  * Save bundle to the database
  *
  * @param Bundle $bundle
  *
  * @return Bundle           Return Bundle with ID and authorship details updated.
  */
 public function save(Bundle $bundle)
 {
     if (!$bundle->getAuthorship()->createdAt()) {
         $bundle->getAuthorship()->create(new DateTimeImmutable(), $this->_user->id);
     }
     $result = $this->_query->run("\n\t\t\tINSERT INTO\n\t\t\t\tdiscount_bundle\n\t\t\t\t(\n\t\t\t\t\t`name`,\n\t\t\t\t\tallow_codes,\n\t\t\t\t\tstart,\n\t\t\t\t\t`end`,\n\t\t\t\t\tcreated_at,\n\t\t\t\t\tcreated_by\n\t\t\t\t)\n\t\t\tVALUES\n\t\t\t\t(\n\t\t\t\t\t:name?s,\n\t\t\t\t\t:allowsCodes?b,\n\t\t\t\t\t:start?dn,\n\t\t\t\t\t:end?dn,\n\t\t\t\t\t:createdAt?d,\n\t\t\t\t\t:createdBy?i\n\t\t\t\t)\n\t\t", ['name' => $bundle->getName(), 'allowsCodes' => $bundle->allowsCodes(), 'start' => $bundle->getStart(), 'end' => $bundle->getEnd(), 'createdAt' => new \DateTime(), 'createdBy' => $this->_user->id]);
     $bundle->setID($result->id());
     $this->_bundleProductCreate->save($bundle);
     $this->_bundlePriceCreate->save($bundle);
     $this->_bundleImageCreate->save($bundle);
     return $bundle;
 }