The question is about doctrine 1.2 and Symfony 1.4
In short: I am running simple SQL query and fetching results into array with PDO. After it, I create Doctrine_Collection of the same table I've fetched data from and call to synchronizeFromArray to load the data into collection.
Everything is fine - collection is created and all the data up there beside of my primary key which happens to be boolean false instead of real value.
Here is example of the code:
// Fetch single object from DB
$sql = "SELECT * FROM payments LIMIT 1";
$p = $connection->query($sql)->fetchAll(PDO::FETCH_ASSOC);
var_dump($p); // I see that all the data including `id` is ok
$c = new Doctrine_Collection('Payment', 'id');
$c->synchronizeFromArray($p);
var_dump($c->toArray()); // All the data is ok but `id` == false
I tried to use Doctrine_Collection::fromArray instead of synchronizeFromArray but it give same result