public static function create($generatorType)
    {
        switch ($generatorType) {
            case ClassMetadata::GENERATOR_TYPE_ASSIGNED:
                $instance = new AssignedIdGenerator();
                break;
            case ClassMetadata::GENERATOR_TYPE_REPOSITORY:
                $instance = new RepositoryIdGenerator();
                break;
            case ClassMetadata::GENERATOR_TYPE_PARENT:
                $instance = new ParentIdGenerator();
                break;
            case ClassMetadata::GENERATOR_TYPE_AUTO:
                $instance = new AutoIdGenerator();
                break;

            default:
                throw new InvalidArgumentException("ID Generator does not exist: $generatorType");
        }

        return $instance;
    }
public static function create($generatorType)
    {
        switch ($generatorType) {
            case ClassMetadata::GENERATOR_TYPE_ASSIGNED:
                $instance = new AssignedIdGenerator();
                break;
            case ClassMetadata::GENERATOR_TYPE_REPOSITORY:
                $instance = new RepositoryIdGenerator();
                break;
            case ClassMetadata::GENERATOR_TYPE_PARENT:
                $instance = new ParentIdGenerator();
                break;
            case ClassMetadata::GENERATOR_TYPE_AUTO:
                $instance = new AutoIdGenerator();
                break;

            default:
                throw new InvalidArgumentException("ID Generator does not exist: $generatorType");
        }

        return $instance;
    }
public static function create ( $ generatorType ) { switch ( $ generatorType ) { case ClassMetadata :: GENERATOR_TYPE_ASSIGNED : $ instance = new AssignedIdGenerator ( ) ; break ; case ClassMetadata :: GENERATOR_TYPE_REPOSITORY : $ instance = new RepositoryIdGenerator ( ) ; break ; case ClassMetadata :: GENERATOR_TYPE_PARENT : $ instance = new ParentIdGenerator ( ) ; break ; case ClassMetadata :: GENERATOR_TYPE_AUTO : $ instance = new AutoIdGenerator ( ) ; break ; default : throw new InvalidArgumentException ( "ID Generator does not exist: $generatorType" ) ; } return $ instance ; }
Factory method for the predefined strategies.

@param int $generatorType

@return IdGenerator
Factory method for the predefined strategies .