-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Phalcon\Mvc\Model\Exception: Column "DB_ROWNUM" doesn't make part of the column map #3256
Comments
Can you please try again using Phalcon 2? |
This is fixed in the 2.0.x branch (Phalcon 2.0.4), you have to change a global ORM setting to allow unexpected columns: \Phalcon\Mvc\Model::setup(['ignoreUnknownColumns' => true]); |
EDIT: I'm moving this into a separate issue. The listed exception was thrown only by my custom-patched Phalcon, please ignore it. Instead, the canonical 2.0.8 Phalcon prints no exception, but no results (which is an error).
//...trimmed model Languages
public function columnMap() {
return array(
'ID_LANGUAGE' => 'id',
'TITLE' => 'title',
'CODE_2' => 'code_2',
'CODE_3' => 'code_3',
'LOCALE' => 'locale'
);
}
// ...later in the code
$result = Languages::find(array('limit' => 2));
echo '<pre>' . var_export($result->toArray(), 1) . '</pre>'; // throws Phalcon\Mvc\Model\Exception: Column 'PHALCON_RN' is not part of the column map The DB used is Oracle 10g. Phalcon 2.0.8. Connection configuration is as follows: 'database' => array(
'adapter' => 'Oracle',
'host' => 'orahost',
'username' => 'webuser1',
'password' => 'secretpswd',
'dbname' => 'monitor',
'schema' => 'COMMON',
'options' => array(
\PDO::ATTR_CASE => \PDO::CASE_UPPER
),
), There are 2 workarounds:
'PHALCON_RN' => '__foo__', to the columnMap then the exception goes away. These are just workarounds though, not acceptable solutions. |
Order::find();will throw a exception : Phalcon\Mvc\Model\Exception: Column "DB_ROWNUM" doesn't make part of the column map
Order::count();will throw a exception:Phalcon\Mvc\Model\Exception: Column "ROWCOUNT" doesn't make part of the column map
i use PDO\Oracle driver
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: