Update ModelToIdTransformer.php

This is to fix problems with entities with 0 as id, empty will return true if u give 0 as parameter
adding unit test for ModelToIdTransformer in the cases where it gets 0 as id
removed test class from the file
Merge pull request #1453 from javiern/patch-1

Update ModelToIdTransformer.php