zfcampus / zf-apigility-skeleton

BSD 3-Clause "New" or "Revised" License
444 stars 123 forks source link

DbConnectedResource create method return nothing #158

Open Hoszi opened 7 years ago

Hoszi commented 7 years ago

In zend-apigility\zf-apigility-skeleton\vendor\zfcampus\zf-apigility\src\DbConnectedResource.php create function has no return data if the collection identifier field is not an auto increment value or there is no auto increment field in table.

$id = $this->table->getLastInsertValue();
return $this->fetch($id);

In my case I have no auto increment field so $id = 0 and the fetch method return "no item found".

My solution:

//$id = $this->table->getLastInsertValue(); return $this->fetch($data[$this->identifierName]);

weierophinney commented 4 years ago

This repository has been closed and moved to laminas-api-tools/api-tools-skeleton; a new issue has been opened at https://github.com/laminas-api-tools/api-tools-skeleton/issues/5.