Skip to content

Commit

Permalink
fixed property conflict in lookup strategy, fixed migration
Browse files Browse the repository at this point in the history
  • Loading branch information
arusinowski committed Jan 6, 2025
1 parent 7cb14e3 commit e16ac85
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
=========

* 2.2.2
* Fixed migration
* Fixed property conflict in lookup strategy
* 2.2.1
* Fix plugin name
* 2.2.0
Expand Down
18 changes: 9 additions & 9 deletions Docs/Documentation/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
composer require cakedc/enum:dev-master
```

## Creating Required Tables

You need to run this command to create the table:

```
bin/cake migrations migrate -p CakeDC/Enum
```

## Load the Plugin

Ensure the Enum Plugin is loaded in your config/bootstrap.php file
Expand All @@ -24,4 +16,12 @@ Plugin::load('CakeDC/Enum');
or
```php
Plugin::loadAll();
```
```

## Creating Required Tables

You need to run this command to create the table:

```
bin/cake migrations migrate -p CakeDC/Enum
```
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
},
"require": {
"php": ">=7.3",
"cakephp/cakephp": "^4.0"
"cakephp/cakephp": "^4.0",
"cakephp/migrations": "^3.9"
},
"require-dev": {
"phpunit/phpunit": "^8.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
use Phinx\Migration\AbstractMigration;
declare(strict_types=1);

use Migrations\AbstractMigration;

class CreateEnumLookups extends AbstractMigration
{
Expand Down
1 change: 1 addition & 0 deletions src/Model/Behavior/Strategy/LookupStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function initialize(array $config): void

$this->_table
->belongsTo($assocName)
->setProperty($assocName . 'Enum')
->setClassName($this->modelClass)
->setForeignKey($config['field'])
->setBindingKey('name')
Expand Down

0 comments on commit e16ac85

Please sign in to comment.