Google\Cloud\Datastore\Key::normalizeElement PHP Method

normalizeElement() private method

Determine the identifier type and return the valid pathElement
private normalizeElement ( string $kind, mixed $identifier, string $identifierType ) : array
$kind string the kind.
$identifier mixed The ID or name.
$identifierType string Either `id` or `name`.
return array
    private function normalizeElement($kind, $identifier, $identifierType)
    {
        $identifierType = $this->determineIdentifierType($identifier, $identifierType);
        $element = [];
        $element['kind'] = $kind;
        if (!is_null($identifier)) {
            $element[$identifierType] = $identifier;
        }
        return $element;
    }