<?
namespace front\factory;

class ShopStatuses {

  // get_baselinker_order_status_id
  static public function get_baselinker_order_status_id( $status_id ) {
    global $mdb;
    return $mdb -> get( 'pp_shop_statuses', 'baselinker_status_id', [ 'id' => $status_id ] );
  }

  // get_apilo_status_id
  static public function get_apilo_status_id( $status_id ) {
    global $mdb;
    return $mdb -> get( 'pp_shop_statuses', 'apilo_status_id', [ 'id' => $status_id ] );
  }

  // get sellasist status id
  static public function get_sellasist_status_id( $status_id ) {
    global $mdb;
    return $mdb -> get( 'pp_shop_statuses', 'sellasist_status_id', [ 'id' => $status_id ] );
  }

  // get_shop_status_by_integration_status_id
  static public function get_shop_status_by_integration_status_id( $integration, $integration_status_id )
  {
    global $mdb;

    if ( $integration == 'sellasist' )
      return $mdb -> get( 'pp_shop_statuses', 'id', [ 'sellasist_status_id' => $integration_status_id ] );

    if ( $integration == 'apilo' )
      return $mdb -> get( 'pp_shop_statuses', 'id', [ 'apilo_status_id' => $integration_status_id ] );
  }
}