code: public function getHydrator()
      {
          if ($this->hydrator === null) {
              if ($this->getEntityPrototype() instanceof ArrayObject) {
                  $hydrator = new Hydrator\ArraySerializable;
              } else {
                  $hydrator = new Hydrator\ClassMethods;
              }
              $this->hydrator = $hydrator;
          }
  
          return $this->hydrator;
      }
docs: {@inheritDoc}