src/wcmf/lib/model/mapper/impl/NodeUnifiedRDBMapper.php
protected function getManyToOneRelationSelectSQL(RelationDescription $relationDescription,
          array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null,
          PagingInfo $pagingInfo=null) {
    $thisAttr = $this->getAttribute($relationDescription->getFkName());
    $tableName = $this->getRealTableName();

    // id parameters
    $parameters = [];
    $idPlaceholder = ':'.$tableName.'_'.$thisAttr->getName();
    for ($i=0, $count=sizeof($otherObjectProxies); $i<$count; $i++) {
      $dbid = $otherObjectProxies[$i]->getValue($relationDescription->getIdName());
      if ($dbid === null) {
        $dbid = SQLConst::NULL();
      }
      $parameters[$idPlaceholder.$i] = $dbid;
    }

    // statement
    $selectStmt = $this->getRelationStatement($thisAttr, $parameters,
          $otherObjectProxies, $otherRole, $criteria, $orderby, $pagingInfo);
    return [$selectStmt, $relationDescription->getIdName(), $relationDescription->getFkName()];
  }
protected function getManyToOneRelationSelectSQL(RelationDescription $relationDescription,
          array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null,
          PagingInfo $pagingInfo=null) {
    $thisAttr = $this->getAttribute($relationDescription->getFkName());
    $tableName = $this->getRealTableName();

    // id parameters
    $parameters = [];
    $idPlaceholder = ':'.$tableName.'_'.$thisAttr->getName();
    for ($i=0, $count=sizeof($otherObjectProxies); $i<$count; $i++) {
      $dbid = $otherObjectProxies[$i]->getValue($relationDescription->getIdName());
      if ($dbid === null) {
        $dbid = SQLConst::NULL();
      }
      $parameters[$idPlaceholder.$i] = $dbid;
    }

    // statement
    $selectStmt = $this->getRelationStatement($thisAttr, $parameters,
          $otherObjectProxies, $otherRole, $criteria, $orderby, $pagingInfo);
    return [$selectStmt, $relationDescription->getIdName(), $relationDescription->getFkName()];
  }
protected function getManyToOneRelationSelectSQL ( RelationDescription $ relationDescription , array $ otherObjectProxies , $ otherRole , $ criteria = null , $ orderby = null , PagingInfo $ pagingInfo = null ) { $ thisAttr = $ this -> getAttribute ( $ relationDescription -> getFkName ( ) ) ; $ tableName = $ this -> getRealTableName ( ) ; // id parameters $ parameters = [ ] ; $ idPlaceholder = ':' . $ tableName . '_' . $ thisAttr -> getName ( ) ; for ( $ i = 0 , $ count = sizeof ( $ otherObjectProxies ) ; $ i < $ count ; $ i ++ ) { $ dbid = $ otherObjectProxies [ $ i ] -> getValue ( $ relationDescription -> getIdName ( ) ) ; if ( $ dbid === null ) { $ dbid = SQLConst :: NULL ( ) ; } $ parameters [ $ idPlaceholder . $ i ] = $ dbid ; } // statement $ selectStmt = $ this -> getRelationStatement ( $ thisAttr , $ parameters , $ otherObjectProxies , $ otherRole , $ criteria , $ orderby , $ pagingInfo ) ; return [ $ selectStmt , $ relationDescription -> getIdName ( ) , $ relationDescription -> getFkName ( ) ] ; }
Get the statement for selecting a many-to-one relation
@see RDBMapper::getRelationSelectSQL()
Get the statement for selecting a many - to - one relation