public function __construct(EntityManager $em, $name, $type, array $fieldDefs, array $config)
{
$this->name = $name;
$this->entityType = $type;
$this->metadata = $em->getClassMetadata($type);
$this->fieldDefs = array();
$this->config = $config;
$this->readFieldDefs($fieldDefs);
$this->defaultDefsFromMetadata();
}