23 private $resetCallback;
37 ?callable $resetCallback =
null
40 foreach (
$slots as $slot ) {
41 $role = $slot->getRole();
54 parent::__construct(
$slots );
55 $this->resetCallback = $resetCallback;
63 if ( !is_array( $this->slots ) ) {
68 $this->slots[$role] = $slot;
69 $this->triggerResetCallback();
98 if ( !is_array( $this->slots ) ) {
102 unset( $this->slots[$role] );
103 $this->triggerResetCallback();
109 private function triggerResetCallback() {
110 if ( $this->resetCallback ) {
111 ( $this->resetCallback )( $this );
Content objects represent page content, e.g.