Skip to content

Commit

Permalink
improve demos ID phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jan 12, 2025
1 parent 7568172 commit 8b0c393
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions demos/init-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ protected function initPreventModification(): void
/**
* Improve testing by using prefixed real field and SQL names.
*
* @property WrappedId $id @Atk4\Field()
*
* @method WrappedId|null getId()
* @method static|null tryLoad(WrappedId $id = null)
* @method static load(WrappedId $id)
* @method \Traversable<WrappedId, static> getIterator()
Expand Down
2 changes: 1 addition & 1 deletion demos/tutorial/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ functionality and more. Next example shows how you can disable user action (add)
$country = new Country($owner->getApp()->db);
$country->getUserAction('add')->enabled = false;
$country->getUserAction('delete')->enabled = static function (Country $entity) {
return $entity->id % 2 === 0;
return $entity->id->getId() % 2 === 0;
};
$country->addUserAction('mail', [
'appliesTo' => Model\UserAction::APPLIES_TO_SINGLE_RECORD,
Expand Down

0 comments on commit 8b0c393

Please sign in to comment.