0, 'entity' => $entity, 'request_action' => $action, 'request_type' => $type, 'request_data' => '', 'server_response' => serialize( 'Error: No url provided' ), 'error' => 1, ] ); return true; } if ( ! self::get_option_control_on_off( $entity ) ) { Logger::save( [ 'object_id' => 0, 'entity' => $entity, 'request_action' => $action, 'request_type' => $type, 'request_data' => serialize( __( 'Error: Data transfer is completely disabled. Check the Entities export settings tab', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'server_response' => serialize( __( 'Error: Data transfer is completely disabled. Check the Entities export settings tab', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'error' => 1, ] ); return true; } switch ( $action ) { case 'CREATE': if ( ( ! self::get_option_control_create( $entity ) ) ) { Logger::save( [ 'object_id' => 0, 'entity' => $entity, 'request_action' => $action, 'request_type' => $type, 'request_data' => serialize( __( 'Error: Data transfer for creation is disabled in the settings', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'server_response' => serialize( __( 'Error: Data transfer for creation is disabled in the settings', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'error' => 1, ] ); return true; } break; case 'CHECKING': case 'UPDATE': if ( ( ! self::get_option_control_update( $entity ) ) ) { Logger::save( [ 'object_id' => 0, 'entity' => $entity, 'request_action' => $action, 'request_type' => $type, 'request_data' => serialize( __( 'Error: Data transfer for update is disabled in the settings', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'server_response' => serialize( __( 'Error: Data transfer for update is disabled in the settings', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'error' => 1, ] ); return true; } break; case 'READ': if ( ( ! self::get_option_control_read( $entity ) ) ) { Logger::save( [ 'object_id' => 0, 'entity' => $entity, 'request_action' => $action, 'request_type' => $type, 'request_data' => serialize( __( 'Error: Data transfer for read is disabled in the settings', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'server_response' => serialize( __( 'Error: Data transfer for read is disabled in the settings', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'error' => 1, ] ); return true; } break; case 'DELETE': if ( ( ! self::get_option_control_delete( $entity ) ) ) { Logger::save( [ 'object_id' => 0, 'entity' => $entity, 'request_action' => $action, 'request_type' => $type, 'request_data' => serialize( __( 'Error: Data transfer for delete is disabled in the setting', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'server_response' => serialize( __( 'Error: Data transfer for delete is disabled in the setting', AINSYS_CONNECTOR_TEXTDOMAIN ) ), 'error' => 1, ] ); return true; } break; } return false; } }