Pass model name to getModelPrimaryKey to prevent "call on a non-object" error.