From 9c9aeeca9f07a37a30b2e11dd64a7743f2adb030 Mon Sep 17 00:00:00 2001 From: bencroker Date: Thu, 20 Jun 2024 15:42:20 +0200 Subject: [PATCH] Add comments --- .../conditions/segments/ContactIsAttendingConditionRule.php | 4 ++++ examples/conditions/segments/ContactIsUserConditionRule.php | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/conditions/segments/ContactIsAttendingConditionRule.php b/examples/conditions/segments/ContactIsAttendingConditionRule.php index 9762723c..7aabc4f1 100644 --- a/examples/conditions/segments/ContactIsAttendingConditionRule.php +++ b/examples/conditions/segments/ContactIsAttendingConditionRule.php @@ -39,10 +39,14 @@ public function getExclusiveQueryParams(): array */ public function modifyQuery(ElementQueryInterface $query): void { + /** + * Gets the RSVP entry that contains an entries field with the handle `attending`, that contains the IDs of the contacts that are attending. + */ $rsvp = Entry::find() ->section('rsvp') ->one(); + /** @phpstan-ignore-next-line */ $ids = $rsvp->attending->ids(); $query->andWhere([ diff --git a/examples/conditions/segments/ContactIsUserConditionRule.php b/examples/conditions/segments/ContactIsUserConditionRule.php index 66144e2d..ffb751bd 100644 --- a/examples/conditions/segments/ContactIsUserConditionRule.php +++ b/examples/conditions/segments/ContactIsUserConditionRule.php @@ -10,7 +10,6 @@ use craft\elements\conditions\ElementConditionRuleInterface; use craft\elements\db\ElementQueryInterface; use putyourlightson\campaign\elements\ContactElement; -use putyourlightson\campaign\elements\db\ContactElementQuery; class ContactIsUserConditionRule extends BaseConditionRule implements ElementConditionRuleInterface { @@ -40,7 +39,9 @@ public function getExclusiveQueryParams(): array */ public function modifyQuery(ElementQueryInterface $query): void { - /** @var ContactElementQuery $query */ + /** + * Filters contacts by those that have non-empty user IDs. + */ $query->andWhere([ 'not', [ 'userId' => null,