Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No listFields() method in Postgre connection #151

Closed
Portaflex opened this issue Jul 10, 2016 · 1 comment
Closed

No listFields() method in Postgre connection #151

Portaflex opened this issue Jul 10, 2016 · 1 comment

Comments

@Portaflex
Copy link
Contributor

Error: Call to undefined method CodeIgniter\Database\Postgre\Connection::listFields()

At BASEPATH/Database/BaseConnection.php at line 1263, method fieldExist() calls listFields() wich is absent

     * Determine if a particular field exists
     *
     * @param   string
     * @param   string
     * @return  bool
     */
    public function fieldExists($fieldName, $tableName)
    {
        return in_array($fieldName, $this->listFields($tableName));
    }
@jim-parry jim-parry changed the title No lisFields() method in Postgre connection No listFields() method in Postgre connection Jul 10, 2016
@Portaflex
Copy link
Contributor Author

Portaflex commented Jul 10, 2016

I found the way as follows:

  • Change method fieldExists() in BaseConnection.php to call method getFieldNames() instead of listFields()
public function fieldExists($fieldName, $tableName)
    {
        return in_array($fieldName, $this->getFieldNames($tableName));
    }

Little changes ... ¡big joy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants