bartko-s / stefano-tree

Framework agnostic Nested Set (MPTT) implementation for PHP
https://bartko-s.github.io/stefano-tree
BSD 3-Clause "New" or "Revised" License
28 stars 8 forks source link

Adapter for Zend_Db (ZF1) #3

Closed tomasfejfar closed 8 years ago

bartko-s commented 8 years ago

Hi @tomasfejfar, great job. But your implementation has one little issue. Original ZF1 db adapter which is used in your implementation does not support nested transaction like Doctrine DBAL or Stefano DB which are used in other adapters and support this behaviours.

tomasfejfar commented 8 years ago

Are nested transactions actually used somewhere in the actual code? I don't believe so (tests worked for me).

There a few options I see:

I think first option would be good enough. It will also make the developer willfully accept the fact that the transactions needs to be handled on the application level.

What do you think?

bartko-s commented 8 years ago

No, nested transaction are not used in the actual code. Tests worked because this behaviour is not tested. I will add this test.

Switch which disable inner transaction is not acceptable for me. It is not clean and robust enough. From my point of view an adapter is better solution.

Do you have any other questions?

tomasfejfar commented 8 years ago

I tried using it on the actual project and having the adapter inside the project is clumsy - the whole project would need dependencies to your Transaction and LockTable... extracting to separate package seems as a sensible solution. I'll try to do it asap

bartko-s commented 8 years ago

I am also working on a ZF1 adapter. It is almost done.

bartko-s commented 8 years ago

Support for ZF1 was added and new version 1.4.0 was released.

tomasfejfar commented 8 years ago

Great! Thanks a lot. I'll try it tomorrow with my existing code...