Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward-Compatibility with #597 #610

Merged
merged 3 commits into from
Jun 7, 2020

Conversation

romaninsh
Copy link
Member

Allows a smooth transition into #597

This should work with v2.0 branch and your code will continue to work going into v2.1 branch.

Example Old Code

$model->addHook('beforeSave', function() {});

Example New code

$model->addHook(\atk4\data\Model::HOOK_BEFORE_SAVE, function() {});

@romaninsh romaninsh requested a review from mvorisek June 7, 2020 16:49
Copy link
Member

@mvorisek mvorisek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise ok

src/Model.php Outdated
public const HOOK_AFTER_SAVE = 'afterSave';

/** @const string Executed when execution of self::atomic() failed. */
public const HOOK_ROLLBACK = self::class . '@rollback';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure it this helps

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be also better to disable StyleCI. Everywhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@romaninsh romaninsh merged commit 1324ec3 into legacy/2.0 Jun 7, 2020
@romaninsh romaninsh deleted the hotfix/upgrade-compatibility-with-597 branch June 7, 2020 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants