Bolt\Storage\Mapping\MetadataDriver::setTaxonomies PHP Method

setTaxonomies() public method

Set the taxonomy.
public setTaxonomies ( string $contentKey, string $className, Doctrine\DBAL\Schema\Table $table )
$contentKey string
$className string
$table Doctrine\DBAL\Schema\Table
    public function setTaxonomies($contentKey, $className, $table)
    {
        if (!isset($this->contenttypes[$contentKey]['taxonomy'])) {
            return;
        }
        foreach ($this->contenttypes[$contentKey]['taxonomy'] as $taxonomytype) {
            $taxonomyConfig = $this->taxonomies[$taxonomytype];
            if (isset($taxonomyConfig['alias'])) {
                $taxonomy = $taxonomyConfig['alias'];
            } else {
                $taxonomy = $taxonomytype;
            }
            $mapping = ['fieldname' => $taxonomy, 'type' => 'null', 'fieldtype' => $this->typemap['taxonomy'], 'target' => $this->schemaManager->getTableName('taxonomy')];
            $this->metadata[$className]['fields'][$taxonomy] = $mapping;
            $this->metadata[$className]['fields'][$taxonomy]['data'] = $taxonomyConfig;
        }
    }