_getBooleanAttribute() improvement and refactored PR 831

Following up on @stof suggestion in https://github.com/l3pp4rd/DoctrineExtensions/pull/831 I updated the fix and improved the implementation of _getBooleanAttribute()