예제 #1
0
 /**
  * @param $onTableAliasName
  * @return null|string
  * @throws NotSupportedException
  */
 protected function addLeftJoinsForARelationAttribute($onTableAliasName)
 {
     assert('is_string($onTableAliasName)');
     if ($this->modelAttributeToDataProviderAdapter->getRelationType() == RedBeanModel::MANY_MANY) {
         return $this->resolveJoinsForForARelationAttributeThatIsManyToMany($onTableAliasName);
     } elseif ($this->modelAttributeToDataProviderAdapter->isRelationTypeAHasManyVariant()) {
         $onTableAliasName = $this->resolveJoinsForForARelationAttributeThatIsAHasManyVariant($onTableAliasName);
         $this->resolveSettingDistinctForARelationAttributeThatIsHasMany();
         return $onTableAliasName;
     } elseif ($this->modelAttributeToDataProviderAdapter->getRelationType() == RedBeanModel::HAS_ONE) {
         return $this->resolveJoinsForForARelationAttributeThatIsAHasOne($onTableAliasName);
     } else {
         throw new NotSupportedException();
     }
 }