Automattic\WooCommerce\Internal\DependencyManagement

ExtendedContainer::reset_replacement()publicWC 1.0

Reset a replaced registration back to its original concrete.

Метод класса: ExtendedContainer{}

Хуков нет.

Возвращает

true|false. True if the registration has been reset, false if no replacement had been made for the specified class name.

Использование

$ExtendedContainer = new ExtendedContainer();
$ExtendedContainer->reset_replacement( $class_name ) : bool;
$class_name(строка) (обязательный)
The class name whose definition had been replaced.

Код ExtendedContainer::reset_replacement() WC 9.3.3

public function reset_replacement( string $class_name ) : bool {
	if ( ! array_key_exists( $class_name, $this->original_concretes ) ) {
		return false;
	}

	$this->extend( $class_name )->setConcrete( $this->original_concretes[ $class_name ] );
	unset( $this->original_concretes[ $class_name ] );

	return true;
}