Automattic\WooCommerce\Internal\ProductFeed\Integrations
IntegrationRegistry{}
IntegrationRegistry
Хуков нет.
Использование
$IntegrationRegistry = new IntegrationRegistry(); // use class methods
Методы
- public get_integration( string $id )
- public get_integrations()
- public register_integration( IntegrationInterface $integration )
- ERROR: no method name found on line ``
- ERROR: no method name found on line ``
- ERROR: no method name found on line ``
- ERROR: no method name found on line ``
- ERROR: no method name found on line ``
- private array()
- ERROR: no method name found on line ``
- ERROR: no method name found on line `}`
- ERROR: no method name found on line ``
Список изменений
| С версии 10.5.0 | Введена. |
Код IntegrationRegistry{} IntegrationRegistry{} WC 10.8.1
class IntegrationRegistry {
/**
* List of all available Integrations.
*
* @var array<string,IntegrationInterface>
*/
private array $integrations = array();
/**
* Register an Integration.
*
* @since 10.5.0
*
* @param IntegrationInterface $integration The integration to register.
*/
public function register_integration( IntegrationInterface $integration ): void {
$this->integrations[ $integration->get_id() ] = $integration;
}
/**
* Get an Integration by ID.
*
* @since 10.5.0
*
* @param string $id The ID of the Integration.
* @return IntegrationInterface|null The Integration, or null if it is not registered.
*/
public function get_integration( string $id ): ?IntegrationInterface {
return $this->integrations[ $id ] ?? null;
}
/**
* Get all registered integrations.
*
* @since 10.5.0
*
* @return array<string,IntegrationInterface>
*/
public function get_integrations(): array {
return $this->integrations;
}
}