modules/acm_sku/src/StockManager.php
private function isStockStatusChanged(array $old, array $new) {
    if ($old['status'] != $new['status']) {
      return TRUE;
    }

    $had_quantity = (bool) $old['quantity'];
    $has_quantity = (bool) $new['quantity'];

    // Either it was zero before or zero now and status says in stock,
    // we consider it is changed.
    if ($new['status'] && $had_quantity != $has_quantity) {
      return TRUE;
    }

    return FALSE;
  }
private function isStockStatusChanged(array $old, array $new) {
    if ($old['status'] != $new['status']) {
      return TRUE;
    }

    $had_quantity = (bool) $old['quantity'];
    $has_quantity = (bool) $new['quantity'];

    // Either it was zero before or zero now and status says in stock,
    // we consider it is changed.
    if ($new['status'] && $had_quantity != $has_quantity) {
      return TRUE;
    }

    return FALSE;
  }
private function isStockStatusChanged ( array $ old , array $ new ) { if ( $ old [ 'status' ] != $ new [ 'status' ] ) { return TRUE ; } $ had_quantity = ( bool ) $ old [ 'quantity' ] ; $ has_quantity = ( bool ) $ new [ 'quantity' ] ; // Either it was zero before or zero now and status says in stock, // we consider it is changed. if ( $ new [ 'status' ] && $ had_quantity != $ has_quantity ) { return TRUE ; } return FALSE ; }
Get field code for which value is requested.

@param array $old
Old stock.
@param array $new
New stock.

@return bool
TRUE if stock status changed.
Get field code for which value is requested .