Bolt\Storage\Mapping\MetadataDriver::setRelations PHP Метод

setRelations() публичный Метод

Set the relationship.
public setRelations ( string $contentKey, string $className, Doctrine\DBAL\Schema\Table $table )
$contentKey string
$className string
$table Doctrine\DBAL\Schema\Table
    public function setRelations($contentKey, $className, $table)
    {
        if (!isset($this->contenttypes[$contentKey]['relations'])) {
            return;
        }
        foreach ($this->contenttypes[$contentKey]['relations'] as $key => $data) {
            if (isset($data['alias'])) {
                $relationKey = $data['alias'];
            } else {
                $relationKey = $key;
            }
            $mapping = ['fieldname' => $relationKey, 'type' => 'null', 'fieldtype' => $this->typemap['relation'], 'entity' => $this->resolveClassName($relationKey), 'target' => $this->schemaManager->getTableName('relations')];
            $this->metadata[$className]['fields'][$relationKey] = $mapping;
            $this->metadata[$className]['fields'][$relationKey]['data'] = $data;
        }
    }