/** * @param null $onTableAliasName * @param bool $canUseFromJoins * @return null|string */ public function resolveJoins($onTableAliasName = null, $canUseFromJoins = true) { assert('is_string($onTableAliasName) || $onTableAliasName == null'); assert('is_bool($canUseFromJoins)'); $onTableAliasName = $this->resolveOnTableAliasName($onTableAliasName); $this->tableAliasNameForBaseModel = $onTableAliasName; $onTableAliasName = $this->resolveJoinsForAttribute($onTableAliasName, $canUseFromJoins); $this->resolvedOnTableAliasName = $onTableAliasName; if ($this->modelAttributeToDataProviderAdapter->hasRelatedAttribute()) { $modelAttributeToDataProviderAdapter = new RedBeanModelAttributeToDataProviderAdapter($this->modelAttributeToDataProviderAdapter->getRelationModelClassNameThatCanHaveATable(), $this->modelAttributeToDataProviderAdapter->getRelatedAttribute()); $builderClassName = get_class($this); $builder = new $builderClassName($modelAttributeToDataProviderAdapter, $this->joinTablesAdapter); $this->tableAliasNameForRelatedModel = $onTableAliasName; $onTableAliasName = $builder->resolveJoinsForAttribute($onTableAliasName, false); } return $onTableAliasName; }