Updated to be compatible with PHP PDO

PDO sets properties on an object before calling the constructor. This requires Entity to retrieve the values from the properties from the object before unsetting them.