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 8.1.1

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;