public function __construct($name, $type, array $options = []) { $this->name = (string) $name; $this->type = $type; $this->is_searchable = \igorw\get_in($options, ['searchable'], true); $this->is_private = \igorw\get_in($options, ['private'], false); $this->facet = \igorw\get_in($options, ['facet']); $this->thesaurus_roots = \igorw\get_in($options, ['thesaurus_roots'], null); $this->used_by_collections = \igorw\get_in($options, ['used_by_collections'], []); Assertion::boolean($this->is_searchable); Assertion::boolean($this->is_private); if ($this->facet !== self::FACET_DISABLED) { Assertion::integer($this->facet); } if ($this->thesaurus_roots !== null) { Assertion::allIsInstanceOf($this->thesaurus_roots, Concept::class); } Assertion::allScalar($this->used_by_collections); }
public function recordCustomEvent($name, array $attributes) { Assertion::string($name); Assertion::notBlank($name); Assertion::allString(array_keys($attributes)); Assertion::allScalar(array_values($attributes)); $this->handle('newrelic_record_custom_event', [$name, $attributes]); }