request = $request; $this->city = $this->validate( 'city' ); $this->code = $this->validate( 'code' ); $this->cod = $this->validate( 'cod' ); $this->end_of_week_collection = $this->validate( 'end_of_week_collection' ); } /** * . * * @param string $name . * * @return string */ private function validate( $name ) { if ( isset( $this->request[ $name ] ) ) { return sanitize_text_field( wp_unslash( $this->request[ $name ] ) ); } return ''; } /** * . * * @return string */ public function get_city() { return $this->city; } /** * . * * @return string */ public function get_code() { return $this->code; } /** * . * * @return string */ public function get_cod() { return $this->cod; } /** * . * * @return string */ public function get_end_of_week_collection() { return $this->end_of_week_collection; } }