protected static function getSpecialized($properties, $adapter)
	{
		// If it's a directory, stop there
		if ($properties['type'] == 'dir')
		{
			return new Directory($properties, $adapter);
		}

		if (!isset($properties['extension']))
		{
			$bits = explode('.', $properties['path']);
			if (count($bits) > 1)
			{
				$properties['extension'] = end($bits);
			}
			else
			{
				$properties['extension'] = '';
			}
		}

		// If it's a file, do we have a more specialized class?
		$file = __DIR__ . '/Type/' . ucfirst($properties['extension']) . '.php';
		if (file_exists($file))
		{
			$class = __NAMESPACE__ . '\\Type\\' . ucfirst($properties['extension']);
			return new $class($properties, $adapter);
		}

		return new File($properties, $adapter);
	}
protected static function getSpecialized($properties, $adapter)
	{
		// If it's a directory, stop there
		if ($properties['type'] == 'dir')
		{
			return new Directory($properties, $adapter);
		}

		if (!isset($properties['extension']))
		{
			$bits = explode('.', $properties['path']);
			if (count($bits) > 1)
			{
				$properties['extension'] = end($bits);
			}
			else
			{
				$properties['extension'] = '';
			}
		}

		// If it's a file, do we have a more specialized class?
		$file = __DIR__ . '/Type/' . ucfirst($properties['extension']) . '.php';
		if (file_exists($file))
		{
			$class = __NAMESPACE__ . '\\Type\\' . ucfirst($properties['extension']);
			return new $class($properties, $adapter);
		}

		return new File($properties, $adapter);
	}
protected static function getSpecialized ( $ properties , $ adapter ) { // If it's a directory, stop there if ( $ properties [ 'type' ] == 'dir' ) { return new Directory ( $ properties , $ adapter ) ; } if ( ! isset ( $ properties [ 'extension' ] ) ) { $ bits = explode ( '.' , $ properties [ 'path' ] ) ; if ( count ( $ bits ) > 1 ) { $ properties [ 'extension' ] = end ( $ bits ) ; } else { $ properties [ 'extension' ] = '' ; } } // If it's a file, do we have a more specialized class? $ file = __DIR__ . '/Type/' . ucfirst ( $ properties [ 'extension' ] ) . '.php' ; if ( file_exists ( $ file ) ) { $ class = __NAMESPACE__ . '\\Type\\' . ucfirst ( $ properties [ 'extension' ] ) ; return new $ class ( $ properties , $ adapter ) ; } return new File ( $ properties , $ adapter ) ; }
Gets the most specialized object for a given entity type

@param   array   $properties  The properties to use to build a new entity from
@param   object  $adapter     The filesystem adapter to use for interaction with the entity
@return  static
Gets the most specialized object for a given entity type