/** * @param mixed $rawValue * @return mixed */ public function toRawValue($rawValue) { return $this->mapper->getJson($rawValue); }
/** * @return Mapper Creates a default one if none defined. */ public function getMapper() { if (!$this->mapper) { $this->mapper = Mapper::createFor($this->className, new Mapper\Mappers\DummyMapper()); } return $this->mapper; }
/** * Object "SomeID" to data "some_id" * @return Mapper */ public static function snakeCase() { return Mapper::create(new SnakeCaseMapper()); }