public static function getTypeByDoctrineType(Type $type) { $mapping = array_flip(self::$mapping); if (isset($mapping[$type->getName()])) { return $mapping[$type->getName()]; } else { return TableInterface::TYPE_VARCHAR; } }
public function doctrineColumnLookup($col_lookup) { if (isset($this->options['expr']) && isset($col_lookup[$this->options['expr']])) { /** * @var $col Column */ $col = $col_lookup[$this->options['expr']]; $this->type = $col->getType(); $this->typeName = self::simplifyTypeName($this->type->getName()); } }
/** * {@inheritdoc} */ public function setType(Type $type) { if ($this->constructed) { $this->setOptions([OroOptions::KEY => [ExtendOptionsManager::TYPE_OPTION => $type->getName()]]); } return parent::setType($type); }
/** * {@inheritdoc} */ public function isCommentedDoctrineType(Type $doctrineType) { if ($doctrineType->getName() === Type::BOOLEAN) { // We require a commented boolean type in order to distinguish between boolean and smallint // as both (have to) map to the same native type. return true; } return parent::isCommentedDoctrineType($doctrineType); }
/** * Get the comment to append to a column comment that helps parsing this type in reverse engineering. * * @param Type $doctrineType * @return string */ public function getDoctrineTypeComment(Type $doctrineType) { return '(DC2Type:' . $doctrineType->getName() . ')'; }
public function testGetName() { $this->assertEquals('str_uuid', $this->type->getName()); }
private function value(EntityManager $em, Type $type, $value) { $platform = $em->getConnection()->getDatabasePlatform(); switch ($type->getName()) { case Type::BOOLEAN: return $type->convertToPHPValue($value, $platform); // json supports boolean values // json supports boolean values default: return $type->convertToDatabaseValue($value, $platform); } }