Skip to content

v0.7.0

Choose a tag to compare

@woduda woduda released this 08 Jun 09:51
· 7 commits to main since this release

What's new

Event API ($client->events())

  • get(GetQuery) — arbitrary query with full typing
  • getById(int) / findByTitle(string) — single-record lookups
  • upcoming(int $limit = 10) — active events with start_date > now, ordered ASC; clock is injectable for deterministic tests
  • between(DateTimeImmutable, DateTimeImmutable) — events within a date range
  • participantCount(int $eventId, ?ParticipantStatus $status = null) — efficient count via select=['row_count']
  • isFull(int $eventId) — compares positive-class participant count against max_participants; false when no cap

Participant API ($client->participants())

  • register(contactId, eventId, status, roleId, source, customFields) — creates a Participant record
  • markAttended(int) — sets status to Attended
  • cancel(int, ?string $reason) — sets status to Cancelled; optionally creates a Follow Up activity
  • checkIn(int, ?DateTimeImmutable $at) — sets status to Attended; optionally creates a Check-in activity with timestamp
  • forEvent(int, ?ParticipantStatus) — all participants for an event, optional status filter
  • forContact(int) — registration history ordered by register_date DESC
  • countByStatus(int $eventId): array<string,int> — single grouped transport call returning status name → count map

ParticipantStatus enum

Backed string enum with three classification methods matching CiviCRM's class column:

Class Statuses Method
Positive Registered, Attended isPositive()
Pending Pending from pay later, On waitlist, Awaiting approval isPending()
Negative No-show, Cancelled, Rejected, Expired isNegative()

ClockInterface + SystemClock

ClockInterface::now(): DateTimeImmutable — injectable wall-clock time for deterministic tests. SystemClock is the default production implementation wired by CiviCrmClient::events().

Quality

576 tests, 99.4% line coverage, PHPStan level max clean, Rector clean, Pint (PER-CS 2.0) clean.