Files
shopPRO/autoload/admin/factory/class.Integrations.php
Jacek Pyziak 847fdbbf3f refactor(shop-statuses): migrate to DI, restructure docs into docs/ folder (0.268)
- Migrate ShopStatuses module to Domain + DI architecture
- Add ShopStatusRepository, ShopStatusesController with color picker
- Convert front\factory\ShopStatuses to facade
- Add FormFieldType::COLOR with HTML5 color picker
- Move documentation files to docs/ folder (PROJECT_STRUCTURE, REFACTORING_PLAN, CHANGELOG, FORM_EDIT_SYSTEM, TESTING, DATABASE_STRUCTURE)
- Tests: 254 tests, 736 assertions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:43:31 +01:00

65 lines
2.2 KiB
PHP

<?php
namespace admin\factory;
/**
* Fasada kompatybilnosci wstecznej.
* Deleguje do Domain\Integrations\IntegrationsRepository.
* Uzywane przez: cron.php, shop\Order, admin\Controllers\ShopStatusesController, admin\controls\ShopTransport, admin\controls\ShopPaymentMethod, admin\controls\ShopProduct.
*/
class Integrations {
private static function repo(): \Domain\Integrations\IntegrationsRepository
{
global $mdb;
return new \Domain\Integrations\IntegrationsRepository( $mdb );
}
// ── Apilo settings ──────────────────────────────────────────
static public function apilo_settings( $name = '' )
{
$repo = self::repo();
return $name ? $repo->getSetting( 'apilo', $name ) : $repo->getSettings( 'apilo' );
}
static public function apilo_settings_save( $field_id, $value )
{
return self::repo()->saveSetting( 'apilo', $field_id, $value );
}
static public function apilo_get_access_token()
{
return self::repo()->apiloGetAccessToken();
}
static public function apilo_authorization( $client_id, $client_secret, $authorization_code )
{
return self::repo()->apiloAuthorize( $client_id, $client_secret, $authorization_code );
}
// ── Apilo product linking ─────────────────────────────────────
static public function apilo_product_select_save( int $product_id, $apilo_product_id, $apilo_product_name )
{
return self::repo()->linkProduct( $product_id, $apilo_product_id, $apilo_product_name );
}
static public function apilo_product_select_delete( int $product_id )
{
return self::repo()->unlinkProduct( $product_id );
}
// ── ShopPRO settings ──────────────────────────────────────────
static public function shoppro_settings( $name = '' )
{
$repo = self::repo();
return $name ? $repo->getSetting( 'shoppro', $name ) : $repo->getSettings( 'shoppro' );
}
static public function shoppro_settings_save( $field_id, $value )
{
return self::repo()->saveSetting( 'shoppro', $field_id, $value );
}
}