}>, done: bool} * * @since 0.1.0 */ public function export( string $email_address, int $page = 1 ): array { unset( $page ); $intents = $this->intents->find_by_draft_email( $email_address ); $data = []; foreach ( $intents as $intent ) { $id = $intent->id(); if ( null === $id ) { continue; } $draft = $intent->customer_draft() ?? []; $rows = [ [ 'name' => __( 'Intent status', 'buildler' ), 'value' => $intent->status()->value, ], [ 'name' => __( 'Current step', 'buildler' ), 'value' => (string) ( $intent->current_step() ?? '' ), ], ]; foreach ( $draft as $key => $value ) { if ( ! is_string( $key ) ) { continue; } $rows[] = [ 'name' => $key, 'value' => is_scalar( $value ) ? (string) $value : (string) wp_json_encode( $value ), ]; } $data[] = [ 'group_id' => 'bookline-order-intents', 'group_label' => __( 'Bookline booking drafts', 'buildler' ), 'item_id' => 'bookline-order-intent-' . $id, 'data' => $rows, ]; } return [ 'data' => $data, 'done' => true, ]; } }