protected function getIdentifier($entity)
    {
        $entityId = json_decode($this->entityRegistry->getEntityId($entity), true);

        if (is_array($entityId)) {
            $identifier = [];

            foreach ($entityId as $key => $value) {
                $key              = strtolower(Normalise::toUnderscoreSeparated(Normalise::fromCamelCase($key)));
                $identifier[$key] = $value;
            }

            return $identifier;
        }

        $primary = $this->builder->getMeta(get_class($entity))->primary;

        return [$primary => $entityId];
    }
protected function getIdentifier($entity)
    {
        $entityId = json_decode($this->entityRegistry->getEntityId($entity), true);

        if (is_array($entityId)) {
            $identifier = [];

            foreach ($entityId as $key => $value) {
                $key              = strtolower(Normalise::toUnderscoreSeparated(Normalise::fromCamelCase($key)));
                $identifier[$key] = $value;
            }

            return $identifier;
        }

        $primary = $this->builder->getMeta(get_class($entity))->primary;

        return [$primary => $entityId];
    }
protected function getIdentifier ( $ entity ) { $ entityId = json_decode ( $ this -> entityRegistry -> getEntityId ( $ entity ) , true ) ; if ( is_array ( $ entityId ) ) { $ identifier = [ ] ; foreach ( $ entityId as $ key => $ value ) { $ key = strtolower ( Normalise :: toUnderscoreSeparated ( Normalise :: fromCamelCase ( $ key ) ) ) ; $ identifier [ $ key ] = $ value ; } return $ identifier ; } $ primary = $ this -> builder -> getMeta ( get_class ( $ entity ) ) -> primary ; return [ $ primary => $ entityId ] ; }
Gets the identifier for an entity

@param   object $entity The entity

@return  array  The identifier as key-value pair(s)
Gets the identifier for an entity