/**
  * Get the data we'd like to cache.
  *
  * This is a bit magical. It iterates through all of the table columns,
  * and checks if a getter for that method exists. If so, it pulls in that
  * value. Otherwise, it will pull in the default value. If you'd like to
  * customize this you should override this function in your child model
  * class.
  *
  * @since 1.0
  *
  * @return array
  */
 public function get_data_to_cache()
 {
     $data = parent::get_data_to_cache();
     unset($data['key']);
     $data['lkey'] = $this->get_key()->get_key();
     $data['release_id'] = $this->get_release() ? $this->get_release()->get_pk() : null;
     return $data;
 }
예제 #2
0
 /**
  * Delete this object.
  *
  * @since 1.0
  *
  * @throws DB\Exception
  */
 public function delete()
 {
     /**
      * Fires before an update record is deleted.
      *
      * @since 1.0
      *
      * @param Update $this
      */
     do_action('itelic_delete_update', $this);
     parent::delete();
     /**
      * Fires after an update record is deleted.
      *
      * @since 1.0
      *
      * @param Update $this
      */
     do_action('itelic_deleted_update', $this);
 }
예제 #3
0
 /**
  * Get the data we'd like to cache.
  *
  * This is a bit magical. It iterates through all of the table columns,
  * and checks if a getter for that method exists. If so, it pulls in that
  * value. Otherwise, it will pull in the default value. If you'd like to
  * customize this you should override this function in your child model
  * class.
  *
  * @since 1.0
  *
  * @return array
  */
 public function get_data_to_cache()
 {
     $data = parent::get_data_to_cache();
     unset($data['key']);
     $data['lkey'] = $this->get_key();
     $data['transaction_id'] = $this->get_transaction() ? $this->get_transaction()->ID : null;
     return $data;
 }
예제 #4
0
 /**
  * Delete this object.
  *
  * @since 1.0
  *
  * @throws DB\Exception
  */
 public function delete()
 {
     /**
      * Fires before a release record is deleted.
      *
      * @since 1.0
      *
      * @param Release $this
      */
     do_action('itelic_delete_release', $this);
     parent::delete();
     /**
      * Fires after a release record is deleted.
      *
      * @since 1.0
      *
      * @param Release $this
      */
     do_action('itelic_deleted_release', $this);
 }
예제 #5
0
 /**
  * Get the data we'd like to cache.
  *
  * This is a bit magical. It iterates through all of the table columns,
  * and checks if a getter for that method exists. If so, it pulls in that
  * value. Otherwise, it will pull in the default value. If you'd like to
  * customize this you should override this function in your child model
  * class.
  *
  * @since 1.0
  *
  * @return array
  */
 public function get_data_to_cache()
 {
     $data = parent::get_data_to_cache();
     $data['lkey'] = $this->get_key();
     $data['transaction_id'] = $this->get_transaction()->ID;
     // account for guest checkouts
     if (!is_int($data['customer'])) {
         $data['customer'] = 0;
     }
     return $data;
 }