Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9137543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:06:58+00:00 2026-06-17T09:06:58+00:00

The attempt to register the soundex function results in: [Syntax Error] line 0, col

  • 0

The attempt to register the soundex function results in:

[Syntax Error] line 0, col 106: Error: Expected end of string, got
‘SOUNDEX’

Class definition:

use Doctrine\ORM\Query\AST\Functions\FunctionNode;

/**
 * SoundexFunction ::= "SOUNDEX" "(" StringPrimary  ")"
 */
class SoundexFunction extends FunctionNode
{
    public $stringExpression = null;

    public function parse(\Doctrine\ORM\Query\Parser $parser)
    {
        $parser->match(Lexer::T_IDENTIFIER);
        $parser->match(Lexer::T_OPEN_PARENTHESIS);
        $this->$stringExpression = $parser->StringPrimary();
        $parser->match(Lexer::T_CLOSE_PARENTHESIS);

    }
    public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
    {
        return 'SOUNDEX(' .
            $this->$stringExpression->dispatch($sqlWalker) .
        ')';
    }
}

config.yml snippet:

orm:
    auto_generate_proxy_classes: "%kernel.debug%"
    entity_managers:
      default:
        auto_mapping: true
        dql:
          string_functions:
            soundex: Mana\ClientBundle\DQL\SoundexFunction

query function:

protected function getMatches($incoming) {
    $em = $this->getDoctrine()->getManager();
    $fname = $incoming['fname'];
    $sname = $incoming['sname'];
    $sql = "select id, active, fname, sname, dob, phys_addr, phys_city
        from ManaClientBundle:Client where SOUNDEX(fname) = SOUNDEX(:fname) and
        SOUNDEX(sname) = SOUNDEX(:sname)
        order by sname, fname";
    $query = $em->createQuery($sql)
        ->setParameters(array(
            'fname' => $fname,
            'sname' => $sname,
        ));
    return $query->getResult();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:06:59+00:00Added an answer on June 17, 2026 at 9:06 am

    Geo, not sure why it’s not working for you. I tried it with the QueryBuilder and it worked. However, I did have to replace your usages of $this->$stringExpression with $this->stringExpression.

    Edit:

    I just tested your code in a bare application, and the issue isn’t in the SOUNDEX, it’s in your SQL. Try assigning an SQL alias to your entity:

    $sql = "select client.id, client.active, client.fname, client.sname, client.dob, client.phys_addr, client.phys_city
            from ManaClientBundle:Client client where SOUNDEX(client.fname) = SOUNDEX(:fname) and
            SOUNDEX(client.sname) = SOUNDEX(:sname)
            order by client.sname, client.fname";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public ActionResult Register(RegisterModel RegisterModel, string returnUrl) { if (ModelState.IsValid) { // Attempt to register
How it is possible to register archetypes.schemaextenders with five.grok . The attempt: class QuickNavExtender(grok.Adapter):
I attempt to use webservice return POCO class generated from entity data model as
When I attempt to deserialize: { tags: {} } into: public static class Foo
I currently use the following function to register a dll that handles context menu
So this error is coming from an attempt to solve another issue I am
Before I attempt to program the following function myself, I wonder if something already
I try to make form for user to register using Wicket. I got user
public ActionResult Register(RegisterModel model) { if (ModelState.IsValid) { // Attempt to register the user
Another attempt at designing a user membership. Got to log in successfully, finds the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.