/**
  * @param string           $sqlExpr
  * @param AbstractPlatform $platform
  * @param string           $columnName
  *
  * @return string
  */
 public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform, $columnName = null)
 {
     if ($columnName != null) {
         $sqlExpr = $columnName . ' + ' . $sqlExpr;
     }
     return parent::convertToDatabaseValueSQL($sqlExpr, $platform, $columnName);
 }
 public function convertToDatabaseValue($value, AbstractPlatform $platform)
 {
     if (!$value) {
         return '';
     }
     if (false === $value instanceof TicketSequenceNumber) {
         throw new \RuntimeException("Value should be a Ticket Sequence Number type.");
     }
     return parent::convertToDatabaseValue($value->getValue(), $platform);
 }
 /**
  * {@inheritdoc}
  */
 public function convertToDatabaseValue($value, AbstractPlatform $platform)
 {
     if (!$value) {
         return '';
     }
     if (!$value instanceof TimeSpent) {
         throw new \RuntimeException('Value should be a Time Spent type.');
     }
     return parent::convertToDatabaseValue($value->getValue(), $platform);
 }
Ejemplo n.º 4
0
 /**
  * Force all fields to use unsigned integers (if DB layer supports it).
  */
 public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
 {
     $fieldDeclaration['length'] = 11;
     $fieldDeclaration['unsigned'] = true;
     return parent::getSQLDeclaration($fieldDeclaration, $platform);
 }
Ejemplo n.º 5
0
 /**
  * Get SQL declaration
  *
  * @param array                                     $fieldDeclaration Field declaration
  * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform         Platform
  *
  * @return string
  */
 public function getSQLDeclaration(array $fieldDeclaration, \Doctrine\DBAL\Platforms\AbstractPlatform $platform)
 {
     $fieldDeclaration['unsigned'] = true;
     return parent::getSQLDeclaration($fieldDeclaration, $platform);
 }
 /**
  * {@inheritdoc}
  */
 public function convertToDatabaseValue($value, AbstractPlatform $platform)
 {
     return parent::convertToDatabaseValue($value === null ? null : $value, $platform);
 }