Jump to content

[SOLVED] Exception: Operator '~=' is not implemented in Fieldtype - how to implement?


Recommended Posts

Hello at all,

I have created a new fieldtype with multiple fields (database columns) in it.  More precisely it holds various company data (fe. company name, street, phone,...) - each in 1 database column.

I want to make these values searchable in the site search, but it always shows me that the selector  '~=' is not implement. It accepts '=' as a selector but not '~='.

How can I implement this specific selector inside a fieldtype, so it does not throw me an error all the times, if I run a query with this selector.

Thank you

PS: My fieldtype class extends from Fieldtype

 

Link to post
Share on other sites

Ok, I got it: Updating my Fieldtype file with this method solved my problem. I found this method inside the FieltypeText.module file.

/**
      	 * Update a query to match the text with a fulltext index
      	 *
      	 * @param PageFinderDatabaseQuerySelect $query
      	 * @param string $table
      	 * @param string $subfield
      	 * @param string $operator
      	 * @param int|string $value
      	 * @return DatabaseQuerySelect
      	 *
      	 */
      	public function getMatchQuery($query, $table, $subfield, $operator, $value) {
      		$ft = new DatabaseQuerySelectFulltext($query);
      		$ft->match($table, $subfield, $operator, $value);
      		return $query;
      	}

 

Link to post
Share on other sites
  • Juergen changed the title to [SOLVED] Exception: Operator '~=' is not implemented in Fieldtype - how to implement?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...