src/app/n2n/impl/persistence/orm/property/CommonEntityPropertyProvider.php
public function setupPropertyIfSuitable(AccessProxy $propertyAccessProxy,
			ClassSetup $classSetup) {

		$annotationSet = $classSetup->getAnnotationSet();
		$propertyName = $propertyAccessProxy->getPropertyName();
		
		if (null !== ($annoDateTime = $annotationSet->getPropertyAnnotation($propertyName, 
				'n2n\persistence\orm\annotation\AnnoDateTime'))) {
			$classSetup->provideEntityProperty(new DateTimeEntityProperty($propertyAccessProxy, 
					$classSetup->requestColumn($propertyName), array($annoDateTime)));
			return;
		}
		
		if (null !== ($annoN2nLocale = $annotationSet->getPropertyAnnotation($propertyName, 
				'n2n\persistence\orm\annotation\AnnoN2nLocale'))) {
			$classSetup->provideEntityProperty(new N2nLocaleEntityProperty($propertyAccessProxy, 
					$classSetup->requestColumn($propertyName)), array($annoN2nLocale));
			return;
		}

		if (null !== ($annoUrl = $annotationSet->getPropertyAnnotation($propertyName,
				'n2n\persistence\orm\annotation\AnnoUrl'))) {
			$classSetup->provideEntityProperty(new UrlEntityProperty($propertyAccessProxy,
					$classSetup->requestColumn($propertyName)), array($annoUrl));
			return;
		}

		if (null !== ($annoLob = $annotationSet->getPropertyAnnotation($propertyName,
				'n2n\persistence\orm\annotation\AnnoLob'))) {
				$classSetup->provideEntityProperty(new LobEntityProperty($propertyAccessProxy,
								$classSetup->requestColumn($propertyName)),
						array($annoLob));
				return;
		}
		
		if (null !== ($annoFile = $annotationSet->getPropertyAnnotation($propertyName, 
				'n2n\persistence\orm\annotation\AnnoFile'))) {
			$classSetup->provideEntityProperty(new FileEntityProperty($propertyAccessProxy, 
							$classSetup->requestColumn($propertyName), 
							$classSetup->requestColumn($propertyName . self::PROP_FILE_NAME_SUFFIX),
									$annoFile->getOriginalNameColumnName()), 
					array($annoN2nLocale));
			return;
		}
		
		if (null !== ($annoManagedFile = $annotationSet->getPropertyAnnotation($propertyName, 
				'n2n\persistence\orm\annotation\AnnoManagedFile'))) {
			$manageFileEntityProperty = new ManagedFileEntityProperty($propertyAccessProxy, 
					$classSetup->requestColumn($propertyName), $annoManagedFile->getLookupId(),
					$annoManagedFile->isCascadeDelete());
					
			if (null !== ($fileLocator = $annoManagedFile->getFileLocator())) {
				$manageFileEntityProperty->setFileLocator($fileLocator);
			} else {
				$manageFileEntityProperty->setFileLocator(new SimpleFileLocator(
						mb_strtolower(IoUtils::stripSpecialChars($classSetup->getClass()->getShortName()))));
			}
			
			$classSetup->provideEntityProperty($manageFileEntityProperty, array($annoN2nLocale));
			return;
		}
		
		if (null !== ($annoBool = $annotationSet->getPropertyAnnotation($propertyName, AnnoBool::class))) {
			$classSetup->provideEntityProperty(new BoolEntityProperty($propertyAccessProxy,
					$classSetup->requestColumn($propertyName)), array($annoBool));
			return;
		}
		
		switch ($propertyAccessProxy->getConstraint()->getTypeName()) {
			case TypeName::BOOL:
				$classSetup->provideEntityProperty(new BoolEntityProperty($propertyAccessProxy,
						$classSetup->requestColumn($propertyName)));
				return;
			case TypeName::INT:
				$classSetup->provideEntityProperty(new IntEntityProperty($propertyAccessProxy,
						$classSetup->requestColumn($propertyName)));
				return;
			case TypeName::FLOAT:
				$classSetup->provideEntityProperty(new IntEntityProperty($propertyAccessProxy,
						$classSetup->requestColumn($propertyName)));
				return;
			case TypeName::STRING:
				$classSetup->provideEntityProperty(new IntEntityProperty($propertyAccessProxy,
						$classSetup->requestColumn($propertyName)));
				return;
		}

		if ($this->checkForRelations($propertyAccessProxy, $classSetup)) {
			return;
		}
		
		if ($this->checkForEmbedded($propertyAccessProxy, $classSetup)) {
			return;
		}
		
		$setterMethodName = PropertiesAnalyzer::buildSetterName($propertyName);
		$class = $classSetup->getClass();
		
		if (!$class->hasMethod($setterMethodName)) return;
		
		$setterMethod = $class->getMethod($setterMethodName);
		
		$parameters = $setterMethod->getParameters();
		if (count($parameters) == 0) return;
		$parameter = current($parameters);
		
		if (null !== ($paramClass = ReflectionUtils::extractParameterClass($parameter))) {
			switch ($paramClass->getName()) {
				case 'DateTime':
					$classSetup->provideEntityProperty(new DateTimeEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
				case 'n2n\l10n\N2nLocale':
					$classSetup->provideEntityProperty(new N2nLocaleEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
				case 'n2n\io\managed\File':
					$classSetup->provideEntityProperty(new FileEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName), null));
					break;
				case Url::class:
					$classSetup->provideEntityProperty(new UrlEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
			}
		}
		
		if (null !== ($type = $parameter->getType())) {
			switch ($type->__toString()) {
				case TypeName::BOOL:
					$classSetup->provideEntityProperty(new BoolEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
				case TypeName::INT:
					$classSetup->provideEntityProperty(new IntEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
			}
		}
	}
public function setupPropertyIfSuitable(AccessProxy $propertyAccessProxy,
			ClassSetup $classSetup) {

		$annotationSet = $classSetup->getAnnotationSet();
		$propertyName = $propertyAccessProxy->getPropertyName();
		
		if (null !== ($annoDateTime = $annotationSet->getPropertyAnnotation($propertyName, 
				'n2n\persistence\orm\annotation\AnnoDateTime'))) {
			$classSetup->provideEntityProperty(new DateTimeEntityProperty($propertyAccessProxy, 
					$classSetup->requestColumn($propertyName), array($annoDateTime)));
			return;
		}
		
		if (null !== ($annoN2nLocale = $annotationSet->getPropertyAnnotation($propertyName, 
				'n2n\persistence\orm\annotation\AnnoN2nLocale'))) {
			$classSetup->provideEntityProperty(new N2nLocaleEntityProperty($propertyAccessProxy, 
					$classSetup->requestColumn($propertyName)), array($annoN2nLocale));
			return;
		}

		if (null !== ($annoUrl = $annotationSet->getPropertyAnnotation($propertyName,
				'n2n\persistence\orm\annotation\AnnoUrl'))) {
			$classSetup->provideEntityProperty(new UrlEntityProperty($propertyAccessProxy,
					$classSetup->requestColumn($propertyName)), array($annoUrl));
			return;
		}

		if (null !== ($annoLob = $annotationSet->getPropertyAnnotation($propertyName,
				'n2n\persistence\orm\annotation\AnnoLob'))) {
				$classSetup->provideEntityProperty(new LobEntityProperty($propertyAccessProxy,
								$classSetup->requestColumn($propertyName)),
						array($annoLob));
				return;
		}
		
		if (null !== ($annoFile = $annotationSet->getPropertyAnnotation($propertyName, 
				'n2n\persistence\orm\annotation\AnnoFile'))) {
			$classSetup->provideEntityProperty(new FileEntityProperty($propertyAccessProxy, 
							$classSetup->requestColumn($propertyName), 
							$classSetup->requestColumn($propertyName . self::PROP_FILE_NAME_SUFFIX),
									$annoFile->getOriginalNameColumnName()), 
					array($annoN2nLocale));
			return;
		}
		
		if (null !== ($annoManagedFile = $annotationSet->getPropertyAnnotation($propertyName, 
				'n2n\persistence\orm\annotation\AnnoManagedFile'))) {
			$manageFileEntityProperty = new ManagedFileEntityProperty($propertyAccessProxy, 
					$classSetup->requestColumn($propertyName), $annoManagedFile->getLookupId(),
					$annoManagedFile->isCascadeDelete());
					
			if (null !== ($fileLocator = $annoManagedFile->getFileLocator())) {
				$manageFileEntityProperty->setFileLocator($fileLocator);
			} else {
				$manageFileEntityProperty->setFileLocator(new SimpleFileLocator(
						mb_strtolower(IoUtils::stripSpecialChars($classSetup->getClass()->getShortName()))));
			}
			
			$classSetup->provideEntityProperty($manageFileEntityProperty, array($annoN2nLocale));
			return;
		}
		
		if (null !== ($annoBool = $annotationSet->getPropertyAnnotation($propertyName, AnnoBool::class))) {
			$classSetup->provideEntityProperty(new BoolEntityProperty($propertyAccessProxy,
					$classSetup->requestColumn($propertyName)), array($annoBool));
			return;
		}
		
		switch ($propertyAccessProxy->getConstraint()->getTypeName()) {
			case TypeName::BOOL:
				$classSetup->provideEntityProperty(new BoolEntityProperty($propertyAccessProxy,
						$classSetup->requestColumn($propertyName)));
				return;
			case TypeName::INT:
				$classSetup->provideEntityProperty(new IntEntityProperty($propertyAccessProxy,
						$classSetup->requestColumn($propertyName)));
				return;
			case TypeName::FLOAT:
				$classSetup->provideEntityProperty(new IntEntityProperty($propertyAccessProxy,
						$classSetup->requestColumn($propertyName)));
				return;
			case TypeName::STRING:
				$classSetup->provideEntityProperty(new IntEntityProperty($propertyAccessProxy,
						$classSetup->requestColumn($propertyName)));
				return;
		}

		if ($this->checkForRelations($propertyAccessProxy, $classSetup)) {
			return;
		}
		
		if ($this->checkForEmbedded($propertyAccessProxy, $classSetup)) {
			return;
		}
		
		$setterMethodName = PropertiesAnalyzer::buildSetterName($propertyName);
		$class = $classSetup->getClass();
		
		if (!$class->hasMethod($setterMethodName)) return;
		
		$setterMethod = $class->getMethod($setterMethodName);
		
		$parameters = $setterMethod->getParameters();
		if (count($parameters) == 0) return;
		$parameter = current($parameters);
		
		if (null !== ($paramClass = ReflectionUtils::extractParameterClass($parameter))) {
			switch ($paramClass->getName()) {
				case 'DateTime':
					$classSetup->provideEntityProperty(new DateTimeEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
				case 'n2n\l10n\N2nLocale':
					$classSetup->provideEntityProperty(new N2nLocaleEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
				case 'n2n\io\managed\File':
					$classSetup->provideEntityProperty(new FileEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName), null));
					break;
				case Url::class:
					$classSetup->provideEntityProperty(new UrlEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
			}
		}
		
		if (null !== ($type = $parameter->getType())) {
			switch ($type->__toString()) {
				case TypeName::BOOL:
					$classSetup->provideEntityProperty(new BoolEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
				case TypeName::INT:
					$classSetup->provideEntityProperty(new IntEntityProperty($propertyAccessProxy,
							$classSetup->requestColumn($propertyName)));
					break;
			}
		}
	}
/* (non-PHPdoc)
@see \n2n\persistence\orm\property\EntityPropertyProvider::setupPropertyIfSuitable()