getProfiles example


#[Package('core')] class Migration1586173614AddAdditionalImportExportProfiles extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1586173614;
    }

    public function update(Connection $connection): void
    {
        foreach ($this->getProfiles() as $profile) {
            $profile['id'] = Uuid::randomBytes();
            $profile['system_default'] = 1;
            $profile['file_type'] = 'text/csv';
            $profile['delimiter'] = ';';
            $profile['enclosure'] = '"';
            $profile['mapping'] = json_encode($profile['mapping'], \JSON_THROW_ON_ERROR);
            $profile['created_at'] = (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT);

            $connection->insert('import_export_profile', $profile);
        }
    }

    
$prefix .= $sibling ? '│ ' : ' ';
        }

        $percent = $this->root ? $profile->getDuration() / $this->root * 100 : 0;

        if ($profile->getDuration() * 1000 < 1) {
            $str = $start."\n";
        } else {
            $str = sprintf("%s %s\n", $start$this->formatTime($profile$percent));
        }

        $nCount = \count($profile->getProfiles());
        foreach ($profile as $i => $p) {
            $str .= $this->dumpProfile($p$prefix$i + 1 !== $nCount);
        }

        return $str;
    }
}

  protected function selectProfile(SymfonyStyle $io) {
    $profiles = $this->getProfiles();

    // If there is a distribution there will be only one profile.     if (count($profiles) == 1) {
      return key($profiles);
    }
    // Display alphabetically by human-readable name, but always put the core     // profiles first (if they are present in the filesystem).     natcasesort($profiles);
    if (isset($profiles['minimal'])) {
      // If the expert ("Minimal") core profile is present, put it in front of       // any non-core profiles rather than including it with them
Home | Imprint | This part of the site doesn't use cookies.