actridge/Spot — Issue #12: Unsucessfull with no errors on entity with no auto increment
Author: TheSavior
Created: 2012-01-20 08:07:06+00:00
State: open

Using mysql, if you have a table with a primary key that is not auto_increment, then when you insert an entity, it goes through this code (line 250+ of Adapter\PDO\Abstract)
```php
$stmt = $this->connection()->prepare($sql);

if($stmt) {
// Execute
if($stmt->execute($binds)) {
$result = $this->connection()->lastInsertId();
} else {
$result = false;
}
} else {
$result = false;
}
```

However, last insert id only returns a meaningful value if the primary key is set to auto increment. Since it is not, the "result" is false. So then when you do a check like:

```php
$success = $mapper->insert($like);

if (!$success) {
print_r($like->errors());
}
```

Then success will be false, but errors won't have anything additional in it.