/** * {@inheritdoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { if ($value && strpos($value, ';') === false) { $value = base64_decode($value); } return parent::convertToPHPValue($value, $platform); }
/** * Converts a value from its database representation to its PHP representation * of this type. * * @param mixed $value The value to convert. * @param AbstractPlatform $platform The currently used database platform. * @return array The PHP representation of the value. */ public function convertToPHPValue($value, AbstractPlatform $platform) { $this->initializeDependencies(); $array = parent::convertToPHPValue($value, $platform); $this->decodeObjectReferences($array); return $array; }
/** * {@inheritdoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { if ($value && !$this->isSerialized($value)) { $value = base64_decode($value); } return parent::convertToPHPValue($value, $platform); }
public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) { if ($value === '' || $value === null) { $value = 'a:0:{}'; } return parent::convertToPHPValue($value, $platform); // TODO: Change the autogenerated stub }
/** * {@inheritdoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { $data = parent::convertToPHPValue($value, $platform); if (count($data) != 3) { throw ConversionException::conversionFailed($value, $this->getName()); } return new Coordinate($data[0], $data[1], $data[2]); }
/** * @param mixed $value * @param AbstractPlatform $platform * * @return array */ public function convertToPHPValue($value, AbstractPlatform $platform) { try { return parent::convertToPHPValue($value, $platform); } catch (ConversionException $exception) { return []; } catch (ContextErrorException $exeption) { return []; } }
/** * Converts a value from its database representation to its PHP representation * of this type. * * @param mixed $value The value to convert. * @param AbstractPlatform $platform The currently used database platform. * @return array The PHP representation of the value. */ public function convertToPHPValue($value, AbstractPlatform $platform) { $this->initializeDependencies(); switch ($platform->getName()) { case 'postgresql': $value = is_resource($value) ? stream_get_contents($value) : $value; $array = parent::convertToPHPValue(hex2bin($value), $platform); break; default: $array = parent::convertToPHPValue($value, $platform); } $this->decodeObjectReferences($array); return $array; }
public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) { if (is_object($value)) { return get_object_vars($value); } else { if (is_array($value)) { return $value; } else { if (!$value) { return array(); } } } return parent::convertToPHPValue($value, $platform); }