protected function getSerializer() { if (!isset($this->_serializer)) { try { $this->_serializer = sfResourceSerializer::getInstance($this->getFormat()); } catch (sfException $e) { $this->_serializer = sfResourceSerializer::getInstance('json'); throw new sfException($e->getMessage()); } } return $this->_serializer; }
/** * Get a serailizer instance from the extension sfDoctrineRestGeneratorPlugin * * @return sfRessourceSerializer An instance of the requested serializer */ protected function getSerializer() { if (!isset($this->serializer)) { try { $this->serializer = sfResourceSerializer::getInstance($this->options['serializer']); } catch (sfException $e) { throw new sfException($e->getMessage()); } } return $this->serializer; }