Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Jun 20, 2024
1 parent 255e712 commit 9c9aeec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
5 changes: 3 additions & 2 deletions examples/conditions/segments/ContactIsUserConditionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9c9aeec

Please sign in to comment.