conditions = $conditions; } public function parse( $search_type, $search_term ) { foreach ( $this->conditions as $condition ) { if ( $condition->match( $search_type ) ) { return $condition->create( $search_term ); } } throw new AWPCP_Exception( sprintf( 'Unknown search type: ', $search_type ) ); } }