laminas-api-tools / api-tools

Laminas API Tools module for Laminas
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
37 stars 19 forks source link

Count on Oci8 adapter #43

Open michalbundyra opened 4 years ago

michalbundyra commented 4 years ago

Hello,

I can't get DB-Connected resources fetch single item from Oracle. I always get a "Item not found" message, but I've noticed that it only occurs when I call $resultSet->count(), because it returns null.

$resultSet = $this->table->select([ $this->identifierName => $id ]);

        if (0 === $resultSet->count()) {
            throw new \Exception('Item not found', 404);
        }

        return $resultSet->current();

Is there any restriction to the Oci8 adapter?

I can get it to work if I don't check count() function, but to do so, I have to overwrite every DB-Connected resource class.


Originally posted by @harrysbaraini at https://github.com/zfcampus/zf-apigility/issues/142

michalbundyra commented 4 years ago

I have exactly the same problem on Oci8. Removing $resultSet->count() in DbConnectedResource#fetch($id) fixes the problem with single items.

I see you have filled an issue here https://github.com/zendframework/zend-db/issues/46 , thanks


Originally posted by @mpalourdio at https://github.com/zfcampus/zf-apigility/issues/142#issuecomment-165724130

michalbundyra commented 4 years ago

Yes, I tried to persuade my boss to use Apigility to rewrite a legacy application, but this problem was an immense wall to that.

Furthermore, as we can note, I got no answer.


Originally posted by @harrysbaraini at https://github.com/zfcampus/zf-apigility/issues/142#issuecomment-189519837

michalbundyra commented 4 years ago

You three are the vested interest.

Why should someone go and fix a bug you're having an issue with?

Please submit a pull request because you are experiencing the problem you're likely best suited to fix it. Rest assured if this results in a patch to Apigility or ZF2 it will get review.


Originally posted by @TomHAnderson at https://github.com/zfcampus/zf-apigility/issues/142#issuecomment-189557308

michalbundyra commented 4 years ago

Sorry man, but I don't want someone to fix a bug for me, I just wanted to know if it's working the way it supposed to be rather than being a bug. Unfortunately I've moved to another job, so I don't have access to a Oracle database neither access to the modified code.


Originally posted by @harrysbaraini at https://github.com/zfcampus/zf-apigility/issues/142#issuecomment-190210656