Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DbConnectedResource create method return nothing #5

Open
weierophinney opened this issue Dec 31, 2019 · 0 comments
Open

DbConnectedResource create method return nothing #5

weierophinney opened this issue Dec 31, 2019 · 0 comments

Comments

@weierophinney
Copy link
Contributor

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]);


Originally posted by @Hoszi at zfcampus/zf-apigility-skeleton#158

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

No branches or pull requests

1 participant