public function transform(AbstractEntity $entity)
 {
     $data = [];
     $data["objectclass"] = [];
     foreach ($entity->getObjects() as $class => $object) {
         $reflectionObject = new \ReflectionObject($object);
         $schema = $this->reader->getClassAnnotation($reflectionObject, Mapper\Schema::class);
         if ($schema->name === null) {
             $name = $reflectionObject->getShortName();
         } else {
             $name = $schema->name;
         }
         $data["objectclass"][] = $name;
     }
     foreach ($entity->getAttributes() as $key => $attribute) {
         switch (get_class($attribute)) {
             case Attribute::class:
                 if ($attribute->get() !== null) {
                     $data[$key] = $attribute->get();
                 }
                 break;
             case ArrayCollection::class:
                 $data[$key] = [];
                 foreach ($attribute as $_attribute) {
                     $data[$key][] = $_attribute->get();
                 }
                 if (count($data[$key]) === 0) {
                     unset($data[$key]);
                 }
                 break;
             default:
                 throw new \InvalidArgumentException();
         }
     }
     return $data;
 }