public function buildInsertSql($entities, $entityClassName, $ignoreFields = array())
    {
        if (count($entities) <= 0) {
            return null;
        }

        $fieldNames = $this->entityManager->getClassMetadata($entityClassName)->getFieldNames();

        $tableName = $this->entityManager->getClassMetadata($entityClassName)->getTableName();
        $tableName = $this->entityManager->getConnection()->quoteIdentifier($tableName);
        $fieldNames = array_diff($fieldNames, $ignoreFields);

        $values = array();

        foreach ($entities as $entity) {
            $insertValues = array();

            foreach ($fieldNames as $fieldName) {
                $value = $entity->{'get'.$fieldName}();

                if ($value instanceof \DateTime) {
                    $value = $value->format('Y-m-d H:i:s');
                }

                $insertValues[] = $this->entityManager->getConnection()->quote($value);
            }

            $values[] = '(' . implode(',', $insertValues) . ')';
        }

        foreach ($fieldNames as $key => $fieldName) {
            $columnName = $this->entityManager->getClassMetadata($entityClassName)->getColumnName($fieldName);
            $fieldNames[$key] = $this->entityManager->getConnection()->quoteIdentifier($columnName);
        }

        $sql = sprintf('INSERT INTO %s (%s) VALUES %s', $tableName, implode(',', $fieldNames), implode(', ', $values));

        return $sql;
    }