Throw an exception when generating a proxy class and the value for a
primary key is missing.
Merge pull request #298 from fredrik-w/silence-e_notice

Silence E_NOTICE warning: "Undefined index".