mapByProperties($this->getProps(), $item); } /** * Summarize an event log * * Includes properties with the apiSummary flag in the event log entry schema. */ public function summarize(EventLogEntry $entry): array { return $this->mapByProperties($this->getSummaryProps(), $entry); } /** * Map a collection of event log entries * * @see self::map */ public function mapMany(Enumerable $collection): Enumerable { $this->collection = $collection; return $collection->map(function ($category) { return $this->map($category); }); } /** * Summarize a collection of event log entries * * @see self::summarize */ public function summarizeMany(Enumerable $collection): Enumerable { $this->collection = $collection; return $collection->map(function ($category) { return $this->summarize($category); }); } /** * Map schema properties of an event log entry to an assoc array */ protected function mapByProperties(array $props, EventLogEntry $entry): array { $output = []; foreach ($props as $prop) { switch ($prop) { default: $output[$prop] = $entry->getData($prop); break; } } return $output; } }