Build the RelationMap objects for this table relationships
438225
public function buildRelations()
    {
        $this->addRelation('Country', '\\Thelia\\Model\\Country', RelationMap::MANY_TO_ONE, array('country_id' => 'id', ), 'CASCADE', null);
        $this->addRelation('DealerShedules', '\\Dealer\\Model\\DealerShedules', RelationMap::ONE_TO_MANY, array('id' => 'dealer_id', ), 'CASCADE', null, 'DealerSheduless');
        $this->addRelation('DealerContact', '\\Dealer\\Model\\DealerContact', RelationMap::ONE_TO_MANY, array('id' => 'dealer_id', ), 'CASCADE', null, 'DealerContacts');
        $this->addRelation('DealerContent', '\\Dealer\\Model\\DealerContent', RelationMap::ONE_TO_MANY, array('id' => 'dealer_id', ), 'CASCADE', 'RESTRICT', 'DealerContents');
        $this->addRelation('DealerFolder', '\\Dealer\\Model\\DealerFolder', RelationMap::ONE_TO_MANY, array('id' => 'dealer_id', ), 'CASCADE', 'RESTRICT', 'DealerFolders');
        $this->addRelation('DealerBrand', '\\Dealer\\Model\\DealerBrand', RelationMap::ONE_TO_MANY, array('id' => 'dealer_id', ), 'CASCADE', 'RESTRICT', 'DealerBrands');
        $this->addRelation('DealerProduct', '\\Dealer\\Model\\DealerProduct', RelationMap::ONE_TO_MANY, array('id' => 'dealer_id', ), 'CASCADE', 'RESTRICT', 'DealerProducts');
        $this->addRelation('DealerAdmin', '\\Dealer\\Model\\DealerAdmin', RelationMap::ONE_TO_MANY, array('id' => 'dealer_id', ), 'CASCADE', 'RESTRICT', 'DealerAdmins');
        $this->addRelation('DealerI18n', '\\Dealer\\Model\\DealerI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'DealerI18ns');
        $this->addRelation('DealerVersion', '\\Dealer\\Model\\DealerVersion', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'DealerVersions');
    }
907153
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(PlayerTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(PlayerTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new PlayerTableMap());
        }
    }
1101251
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(DealerFolderVersionTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(DealerFolderVersionTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new DealerFolderVersionTableMap());
      }
    }
1079984
private Map<String, Object> populateRelations(List<String> relations, Object[] o)
    {
        Map<String, Object> relationVal = new HashMap<String, Object>(relations.size());
        int counter = 1;
        for (String r : relations)
        {
            relationVal.put(r, o[counter++]);
        }
        return relationVal;
    }
442093
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(RecordTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(RecordTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new RecordTableMap());
        }
    }
1136045
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(SmartyFilterTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(SmartyFilterTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new SmartyFilterTableMap());
        }
    }
253890
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(GamecurrencyTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(GamecurrencyTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new GamecurrencyTableMap());
        }
    }
582321
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(DealerShedulesTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(DealerShedulesTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new DealerShedulesTableMap());
      }
    }
1007607
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(DealerContentTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(DealerContentTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new DealerContentTableMap());
      }
    }
247825
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(PersonFunctionLinkTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(PersonFunctionLinkTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new PersonFunctionLinkTableMap());
      }
    }
141273
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(PersonVersionTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(PersonVersionTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new PersonVersionTableMap());
      }
    }
1073103
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(KstrukturTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(KstrukturTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new KstrukturTableMap());
        }
    }
552538
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(ReferenceTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(ReferenceTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new ReferenceTableMap());
        }
    }
541357
function mapRelation(rel, modelName, relName) {
    let acceptingParams = Object.assign({}, {
        filter: {
            generated: false,
            type: 'JSON'
        }
    }, connectionArgs);
    types[modelName].meta.fields[relName] = {
        generated: true,
        meta: {
            relation: true,
            connection: true,
            relationType: rel.type,
            isMany: isManyRelation(rel.type),
            embed: rel.embed,
            type: rel.modelTo.modelName,
            args: acceptingParams,
        },
        resolve: (obj, args, context, info) => {

            const ctxOptions = { accessToken: context.req.accessToken }
            const modelId = args && args.id;

            const method = rel.modelTo.sharedClass.findMethodByName('find');
            // TODO: ...
            return new Promise((resolve, reject) => { resolve(true) }).then(() => {
                let params = {};

                _.forEach(acceptingParams, (param, name) => {
                    if (typeof args[name] !== 'undefined' && Object.keys(args[name]).length > 0) {
                        _.merge(params, _.cloneDeep(args[name]));
                    }
                });

                if (isManyRelation(rel.type) === true) {
                    return connectionFromPromisedArray(findRelatedMany(rel, obj, params, context), args, rel.modelTo);
                } else {
                    return findRelatedOne(rel, obj, params, context);
                }

                // let wrap = promisify(model[method.name](...params, ctxOptions));

                // if (typeObj.list) {
                //     return connectionFromPromisedArray(wrap, args, model);
                // } else {
                //     return wrap;
                // }


            }).catch((err) => {
                throw err;
            });
        }
    };
}
1292354
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(StructureNodeParentTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(StructureNodeParentTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new StructureNodeParentTableMap());
        }
    }
439863
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(PageTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(PageTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new PageTableMap());
        }
    }
302384
private function buildRelationships() {
        /** @var Relationship[] $relationships */
        $relationships = array();
        $dbCompareTable = new Table($this->getConfiguration()->getConnection(), $this->getTableName());
        foreach($dbCompareTable->getConstraints() as $constraint) {
            $relationship = new Relationship(
                $this->getConfiguration(),
                $this->getTableName(),
                implode(', ', $constraint->getLocalColumns()),
                $constraint->getRemoteTable(),
                implode(', ', $constraint->getRemoteColumns()),
                'belongsTo',
                'ON DELETE ' . $constraint->getDeleteAction() . ' ON UPDATE ' . $constraint->getUpdateAction()
            );
            $this->getAbstractClass()->addUse('Phalcon\Mvc\Model\Relation');
            $this->getAbstractClass()->addUse($relationship->getRemoteModel() . ' as Child' . $relationship->getRemoteShortModel());
            $relationships[] = $relationship;
        }

        //Get One to Many relationships

        $database = $this->getCurrentDatabaseName();
        $sql = 'SELECT DISTINCT(TABLE_NAME) as tableName FROM information_schema.`KEY_COLUMN_USAGE` WHERE REFERENCED_TABLE_NAME="' . $this->getTableName() . '" AND REFERENCED_TABLE_SCHEMA="' . $database . '"';
        /** @var ResultSet $results */
        $foreignKeys = $this->getConfiguration()->getConnection()->query($sql);
        while($foreignKey = $foreignKeys->fetch()) {
            $foreignKey = (object)$foreignKey;
            $tableName = $foreignKey->tableName;

            $dbCompareTable = new Table($this->getConfiguration()->getConnection(), $tableName);
            foreach($dbCompareTable->getConstraints() as $constraint) {
                if($constraint->getRemoteTable() == $this->getTableName()) {
                    if(implode(', ', $constraint->getRemoteColumns())==='venueId`, `userID') {
                        exit;
                    }
                    $relationship = new Relationship(
                        $this->getConfiguration(),
                        $this->getTableName(),
                        implode(', ', $constraint->getRemoteColumns()),
                        $tableName,
                        implode(', ', $constraint->getLocalColumns()),
                        'hasMany',
                        'ON DELETE ' . $constraint->getDeleteAction() . ' ON UPDATE ' . $constraint->getUpdateAction()
                    );
                    $this->getAbstractClass()->addUse('Phalcon\Mvc\Model\Relation');
                    $this->getAbstractClass()->addUse($relationship->getRemoteModel() . ' as Child' . $relationship->getRemoteShortModel());
                    $this->getAbstractClass()->addUse('Phalcon\Mvc\Model\Relation');
                    $this->getAbstractClass()->addUse('Phalcon\Mvc\Model\Resultset\Simple as ResultSet');
                    $this->getAbstractClass()->addUse($relationship->getRemoteModel() . ' as Child' . $relationship->getRemoteShortModel());
                    $relationships[] = $relationship;
                }
            }

        }
        foreach($relationships as $relationship) {
            $relationship->setRelationships($relationships);
        }
        $this->setRelationships($relationships);
    }