dereuromark / cakephp-tools

A CakePHP Tools plugin containing lots of useful helpers, behaviors, components, shells, ...
http://www.dereuromark.de
MIT License
336 stars 142 forks source link

Bitmask behavior custom finder should use table alias? #203

Closed sdevore closed 6 years ago

sdevore commented 6 years ago

So I was trying out the Bitmasked behavior and noticed that the custom finder findBitmasked doesn't use the table alias in the construction of the query. Would it be more robust to use return $query->where([$this->getTable()->getAlias() . '.' . $this->_config['field'] => $bits]);

Or is there a reason that this is not needed?

sdevore commented 6 years ago

Do you want me to do a pull request with this change (I can make it more consistent with how you have structured isBit so more like $this->_table->alias() I was shying away from that and going to the getters since they seem to be more consistent with the CakePHP core

dereuromark commented 6 years ago

Resolved with https://github.com/dereuromark/cakephp-tools/pull/205