public function transform($entity) {
    if ($entity === NULL) {
      return NULL;
    }

    $getter = 'get'.ucfirst($this->identifierName);

    return array(
      '__class' => $this->entityClass, // just for verbose
      $this->identifierName => $entity->$getter()
    );
  }