entity_type ); if ( TMDO_Mode_Manager::MODE_AEAV_ONLY !== $current ) { $this->log( $job, "↪ Demote skipped (mode is {$current}, not aeav_only)" ); return array( 'status' => 'ok' ); } // Two-step demotion: aeav_only → shadow_read → dual_write. $r = TMDO_Mode_Manager::set( $this->entity_type, TMDO_Mode_Manager::MODE_SHADOW_READ ); if ( is_wp_error( $r ) ) { throw new \RuntimeException( 'Demote step 1 failed: ' . $r->get_error_message() ); } $r = TMDO_Mode_Manager::set( $this->entity_type, TMDO_Mode_Manager::MODE_DUAL_WRITE ); if ( is_wp_error( $r ) ) { throw new \RuntimeException( 'Demote step 2 failed: ' . $r->get_error_message() ); } $this->log( $job, 'Mode: aeav_only → dual_write (reads now go to EAV)' ); return array( 'status' => 'ok' ); } }