Skip to content

Releases: dereuromark/cakephp-tools

3.7.0

04 Sep 13:59
0cf4c99
Compare
Choose a tag to compare

Fixes

  • Fixed upcoming method conflict with log(), so renamed into logException()

2.6.2

17 Aug 12:26
Compare
Choose a tag to compare

Fixes

  • Fixed missing shims for title attribute

3.6.4

03 Jul 14:17
a917b0d
Compare
Choose a tag to compare

Fixes

  • Fixed Table::relatedInUse()

Included commits: 3.6.3...3.6.4

3.6.3

20 Mar 12:50
Compare
Choose a tag to compare

Fixes

  • Fixed up DateTime difference()

3.6.2

29 Feb 14:23
4ee819f
Compare
Choose a tag to compare

Fixes

  • Fixed Sluggable behavior to not modify slug if the entity is not fully hydrated for the label fields.

3.6.1

23 Feb 17:41
Compare
Choose a tag to compare

Improvements

  • Allow local skip of trim in CommonComponent (per controller/action)

Fixes

  • Fixed ErrorHandlerTrait log404 config

3.6.0

13 Feb 12:35
a8e4999
Compare
Choose a tag to compare

Improvements

  • Added autoLink() / autoLinkUrls() improvements.

Fixes

  • Fixed Sluggable behavior to work with joined queries.

3.5.0

07 Feb 23:34
Compare
Choose a tag to compare

Improvements

  • Fixed up DateTime output for $this->Time->niceDate()
  • 404 detection (logging) also for badly behaving crawlers or search engines

3.4.0

23 Jan 06:28
ed75342
Compare
Choose a tag to compare

Improvements

  • Added Encryption behavior

3.3.0

04 Jan 22:56
Compare
Choose a tag to compare

Improvements

Added Enum support for Bitmasked behavior

use App\Model\Enum\CommentStatus;

$this->Comments->addBehavior('Tools.Bitmasked', [
    'bits' => CommentStatus::class, 
    'mappedField' => 'statuses'],
);

By using an Enum for bits it will automatically switch the incoming and outcoming bit values to Enum instances.

You can also manually set the bits using an array, but then you would have to also set enum to the Enum class:

$this->Comments->addBehavior('Tools.Bitmasked', [
    'bits' => CommentStatus::tryFrom(CommentStatus::None->value)::options(), 
    'enum' =>  CommentStatus::class, 
    'mappedField' => 'statuses'],
);

Live demo: https://sandbox.dereuromark.de/sandbox/tools-examples/bitmask-enums