public function validate(FileAbstraction $entity, $typeName, $sourceFilePath = null)
	{
		$siblings = $entity->getSiblings();
		$creatingFilename = $entity->getFileName();

		foreach ($siblings as $record) {
			/* @var $record File */
			
			if ( ! $record->equals($entity)) {
				$recordName = $record->getFileName();
				
				$creatingFilename = mb_strtolower($creatingFilename);
				$recordName = mb_strtolower($recordName);

				if ($creatingFilename == $recordName) {
					$message = $typeName . ' with this name already exists.';
					
					throw new Exception\DuplicateFileNameException(self::EXCEPTION_MESSAGE_KEY, $message);
				}
			}
		}
	}
public function validate(FileAbstraction $entity, $typeName, $sourceFilePath = null)
	{
		$siblings = $entity->getSiblings();
		$creatingFilename = $entity->getFileName();

		foreach ($siblings as $record) {
			/* @var $record File */
			
			if ( ! $record->equals($entity)) {
				$recordName = $record->getFileName();
				
				$creatingFilename = mb_strtolower($creatingFilename);
				$recordName = mb_strtolower($recordName);

				if ($creatingFilename == $recordName) {
					$message = $typeName . ' with this name already exists.';
					
					throw new Exception\DuplicateFileNameException(self::EXCEPTION_MESSAGE_KEY, $message);
				}
			}
		}
	}
public function validate ( FileAbstraction $ entity , $ typeName , $ sourceFilePath = null ) { $ siblings = $ entity -> getSiblings ( ) ; $ creatingFilename = $ entity -> getFileName ( ) ; foreach ( $ siblings as $ record ) { /* @var $record File */ if ( ! $ record -> equals ( $ entity ) ) { $ recordName = $ record -> getFileName ( ) ; $ creatingFilename = mb_strtolower ( $ creatingFilename ) ; $ recordName = mb_strtolower ( $ recordName ) ; if ( $ creatingFilename == $ recordName ) { $ message = $ typeName . ' with this name already exists.' ; throw new Exception \ DuplicateFileNameException ( self :: EXCEPTION_MESSAGE_KEY , $ message ) ; } } } }
Shared validation function
@param FileAbstraction $file
Shared validation function