wpdb; if(BookingReadScope::active()){ $rows=BookingReadScope::remember($wpdb,$this->table.':series-rules',function(){ $wpdb = $this->wpdb; $rows=$wpdb->get_results($wpdb->prepare('SELECT * FROM %i ORDER BY id',$this->table),ARRAY_A);$this->checkRead();return array_map([$this,'serialize'],$rows); }); return array_values(array_filter($rows,static fn($r)=>(null===$r['resource_id']||$r['resource_id']===$resource_id)&&$r['exception_date']===$date)); } $rows = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM %i WHERE (resource_id IS NULL OR resource_id = %d) AND exception_date = %s ORDER BY id', $this->table, $resource_id, $date ), ARRAY_A ); $this->checkRead(); return array_map( [ $this, 'serialize' ], $rows ); } }