public function getEntityProperties($entity)
    {
        $metadata = $this->em->getClassMetadata(get_class($entity));
        return array_merge($metadata->getFieldNames(), $metadata->getAssociationNames());
    }