Open Hoszi opened 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]);
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.
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.
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]);