/**
  * {@inheritdoc}
  */
 public function remove($key)
 {
     $removed = parent::remove($key);
     if ($removed) {
         $this->changed();
     }
     return $removed;
 }
 /**
  * {@inheritdoc}
  */
 public function remove($key)
 {
     // TODO: If the keys are persistent as well (not yet implemented)
     //       and the collection is not initialized and orphanRemoval is
     //       not used we can issue a straight SQL delete/update on the
     //       association (table). Without initializing the collection.
     $removed = parent::remove($key);
     if (!$removed) {
         return $removed;
     }
     $this->changed();
     if ($this->association !== null && $this->association['type'] & ClassMetadata::TO_MANY && $this->owner && $this->association['orphanRemoval']) {
         $this->em->getUnitOfWork()->scheduleOrphanRemoval($removed);
     }
     return $removed;
 }