Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

DbConnectedResource create method return nothing #158

Open
Hoszi opened this issue Apr 3, 2017 · 1 comment
Open

DbConnectedResource create method return nothing #158

Hoszi opened this issue Apr 3, 2017 · 1 comment

Comments

@Hoszi
Copy link

Hoszi commented Apr 3, 2017

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
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-skeleton; a new issue has been opened at laminas-api-tools/api-tools-skeleton#5.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants