{"action":"opened","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/10454","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10454/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10454/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10454/events","html_url":"https://github.com/phalcon/cphalcon/issues/10454","id":83526274,"number":10454,"title":"DbProfiler getSqlVariables problem","user":{"login":"altairo2087","id":7862433,"avatar_url":"https://avatars.githubusercontent.com/u/7862433?v=3","gravatar_id":"","url":"https://api.github.com/users/altairo2087","html_url":"https://github.com/altairo2087","followers_url":"https://api.github.com/users/altairo2087/followers","following_url":"https://api.github.com/users/altairo2087/following{/other_user}","gists_url":"https://api.github.com/users/altairo2087/gists{/gist_id}","starred_url":"https://api.github.com/users/altairo2087/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/altairo2087/subscriptions","organizations_url":"https://api.github.com/users/altairo2087/orgs","repos_url":"https://api.github.com/users/altairo2087/repos","events_url":"https://api.github.com/users/altairo2087/events{/privacy}","received_events_url":"https://api.github.com/users/altairo2087/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-01T14:27:00Z","updated_at":"2015-06-01T14:27:00Z","closed_at":null,"body":"Sorry for my bad english. I have a problem.\r\n\r\nPHP 5.5.19 MSVC11 TS x86, Phalcon 2.0.2, Postgres 9.3\r\n\r\n```php\r\n$eventsManager = new Manager();\r\n//Get a shared instance of the DbProfiler\r\n$profiler      = $di->get('profiler');\r\n//Listen all the database events\r\n$eventsManager->attach('db', function($event, $connection) use ($profiler) {\r\n    if ($event->getType() == 'beforeQuery') {\r\n        $profiler->startProfile($connection->getSQLStatement());\r\n    }\r\n    if ($event->getType() == 'afterQuery') {\r\n        $profiler->stopProfile();\r\n    }\r\n});\r\n//Assign the eventsManager to the db adapter instance\r\n$di->get('db')->setEventsManager($eventsManager);\r\n```\r\n```php\r\n$profiles = $this->getDI()->get('profiler')->getProfiles();\r\n....\r\n/* @var $profile \\Phalcon\\Db\\Profiler\\Item */\r\n[\r\n    'SQL' => $profile->getSQLStatement(),\r\n    'Variables' => $profile->getSqlVariables(),\r\n    'Bind' => $profile->getSqlBindTypes(),\r\n    'Start' => $profile->getInitialTime(),\r\n    'Final' => $profile->getFinalTime(),\r\n    'Total' => $profile->getTotalElapsedSeconds(),\r\n]\r\n```\r\n\r\nresult on all queries:\r\n```javascript\r\n{\r\n    SQL: \"UPDATE \"sometable\" SET \"somefield\" = ?, \"somefield\" = ? WHERE \"somefield\" = ?\"  // ---- ?\r\n    Variables: null         // ---- ?\r\n    Bind: null              // ---- ?\r\n    Start: 1433167173.7251\r\n    Final: 1433167173.7276\r\n    Total: 0.002540111541748\r\n}\r\n```"}}