Put result of primary_key() method into a variable

This avoid the notice : "Only variables should be passed by reference" that could appear here.