Skip to content

callable scenarios for actions: create, update, delete #9

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

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

siggi-k
Copy link

@siggi-k siggi-k commented Dec 17, 2024

callable scenarios for actions: create, update, delete

/**
 * @var string|callable
 * string - the scenario to be assigned to the model before it is validated and saved.
 * callable - a PHP callable that will be executed during the action.
 * It must return a string representing the scenario to be assigned to the model before it is validated and saved.
 *  The signature of the callable should be as follows,
 *  ```php
 *  function ($action, $model) {
 *      // $model is the requested model instance.
 *  }
 *  ```
 */
public $scenario = Model::SCENARIO_DEFAULT;

@siggi-k siggi-k self-assigned this Dec 17, 2024
@siggi-k siggi-k requested a review from cebe December 17, 2024 12:46
@cebe cebe added this to the 1.5.1 milestone Dec 18, 2024
@cebe cebe merged commit 83eac62 into php-openapi:master Dec 18, 2024
4 checks passed
@cebe
Copy link
Member

cebe commented Dec 18, 2024

Thank you!

@cebe cebe added the enhancement New feature or request label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants