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

Deprecate api command #337

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

colemanw
Copy link
Contributor

APIv3 is officially deprecated so civix should reflect that.

Also adds @deprecated annotation to all deprecated commands.

APIv3 is officially deprecated so civix should reflect that.
@totten
Copy link
Owner

totten commented Sep 26, 2024

Wouldn't it make sense to switch this to the APIv4 equivalent?

One thing - APIv4 is in a funnier position because of how Civi\Api4\MyEntity.php and Civi\Api4\Action\MyEntity\MyAction.php relate. IIRC:

  • When you generate an action class, you should update the entity class to declare a stub.
  • But only if your extension owns the entity. You skip the stub if entity is owned by someone else.
  • Adding the stub function requires modifying the PHP source. That can be fiddly, but there's a big mitigating factor -- you don't have to worry about pre-existing functions. I'd wager 98% cases would work with a little regex to inject the new function at the end of the file (right before the terminal }).

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.

2 participants