factored out PDOEntityAdaptor.php