37 private $resetCallback;
51 ?callable $resetCallback =
null
54 foreach (
$slots as $slot ) {
55 $role = $slot->getRole();
69 parent::__construct(
$slots );
70 $this->resetCallback = $resetCallback;
80 if ( !is_array( $this->slots ) ) {
85 $this->slots[$role] = $slot;
86 $this->triggerResetCallback();
117 if ( !is_array( $this->slots ) ) {
121 unset( $this->slots[$role] );
122 $this->triggerResetCallback();
128 private function triggerResetCallback() {
129 if ( $this->resetCallback ) {
130 ( $this->resetCallback )( $this );
Base interface for representing page content.