Skip to content

Table aliases show up as different tables #7

@yourpropertyexpert

Description

@yourpropertyexpert

I'm using this to track which of our classes reference which tables. (We use much more complex SQL than an ORM would need.)

One small point is that a table that is brought into a particular query with an alias reports as ":TABLENAME: :ALIAS:".

So, we ended up writing (inside a little foreach loop) to dedupe the returned list of tables:

if (str_contains($thistable, " ")) {
    $thistable = explode(" ", $thistable)[0];
}

It would be nice if the getAllTables() method could do this, either by default or if passed an (optional) OPTIONS parameter with some appropriate value.

... or introduce a new getAllTablesWithoutAliases() method.

If you'd be happy with the third option, I'd be happy to try a PR for you...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions