src/Event.php
private function validate() {
        $errors = [];

        foreach ($this->eventDetails as $key => $value) {
            if (strpos($key, 'tp_') !== false) {
                $errors[$key] = 'Property names cannot start with the reserved prefix \'tp_\'';
            }
            if (strpos($key, '.') !== false) {
                $errors[$key] = 'Property names cannot contain a period (.)';
            }
            if (strcmp($key, '_id') == 0) {
                $errors[$key] = 'Top level properties cannot be named \'_id\'';
            }
        }

        if (!empty($errors)) {
            throw new InvalidPropertyNameException($errors);
        }
    }
private function validate() {
        $errors = [];

        foreach ($this->eventDetails as $key => $value) {
            if (strpos($key, 'tp_') !== false) {
                $errors[$key] = 'Property names cannot start with the reserved prefix \'tp_\'';
            }
            if (strpos($key, '.') !== false) {
                $errors[$key] = 'Property names cannot contain a period (.)';
            }
            if (strcmp($key, '_id') == 0) {
                $errors[$key] = 'Top level properties cannot be named \'_id\'';
            }
        }

        if (!empty($errors)) {
            throw new InvalidPropertyNameException($errors);
        }
    }
private function validate ( ) { $ errors = [ ] ; foreach ( $ this -> eventDetails as $ key => $ value ) { if ( strpos ( $ key , 'tp_' ) !== false ) { $ errors [ $ key ] = 'Property names cannot start with the reserved prefix \'tp_\'' ; } if ( strpos ( $ key , '.' ) !== false ) { $ errors [ $ key ] = 'Property names cannot contain a period (.)' ; } if ( strcmp ( $ key , '_id' ) == 0 ) { $ errors [ $ key ] = 'Top level properties cannot be named \'_id\'' ; } } if ( ! empty ( $ errors ) ) { throw new InvalidPropertyNameException ( $ errors ) ; } }
Checks if an event is valid for Connect.
@throws InvalidPropertyNameException if the event contains invalid properties.
Checks if an event is valid for Connect .