diff --git a/demos/init-db.php b/demos/init-db.php index e44c58c6cb..7f2e7e2993 100644 --- a/demos/init-db.php +++ b/demos/init-db.php @@ -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 getIterator() diff --git a/demos/tutorial/actions.php b/demos/tutorial/actions.php index 9e418aabf0..d3a983c9ba 100644 --- a/demos/tutorial/actions.php +++ b/demos/tutorial/actions.php @@ -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,