library/Extlib/Generator.php
static public function generateDoctrine2(\Doctrine\ORM\EntityManager $entityManager, $entityName, $field, $length = 16)
    {    
        do {
            $generate = self::generate($length);
        } while (self::doctrine2Query($entityManager, $entityName, $field, $generate));
        
        return $generate;
    }
static public function generateDoctrine2(\Doctrine\ORM\EntityManager $entityManager, $entityName, $field, $length = 16)
    {    
        do {
            $generate = self::generate($length);
        } while (self::doctrine2Query($entityManager, $entityName, $field, $generate));
        
        return $generate;
    }
Doctrine v2.x generate method

@param \Doctrine\ORM\EntityManager $entityManager
@param string $entityName
@param string $field
@param int $length
@return string