src/wcmf/lib/model/mapper/SelectStatement.php
public function addColumns(array $columns, $joinName=null) {
    if ($joinName === null) {
      // add normal column
      $this->columns = $this->columns + $columns;
    }
    else {
      // add column to join
      $joins = [];
      foreach ($this->joins->getJoins() as $join) {
        if ($join['name'] == $joinName || in_array($joinName, array_keys($join['name']))) {
          $join['columns'] += $columns;
        }
        $joins[] = $join;
      }
      $this->joins->reset();
      foreach ($joins as $join) {
        parent::join($join['name'], $join['on'], $join['columns'], $join['type']);
      }
    }
  }
public function addColumns(array $columns, $joinName=null) {
    if ($joinName === null) {
      // add normal column
      $this->columns = $this->columns + $columns;
    }
    else {
      // add column to join
      $joins = [];
      foreach ($this->joins->getJoins() as $join) {
        if ($join['name'] == $joinName || in_array($joinName, array_keys($join['name']))) {
          $join['columns'] += $columns;
        }
        $joins[] = $join;
      }
      $this->joins->reset();
      foreach ($joins as $join) {
        parent::join($join['name'], $join['on'], $join['columns'], $join['type']);
      }
    }
  }
public function addColumns ( array $ columns , $ joinName = null ) { if ( $ joinName === null ) { // add normal column $ this -> columns = $ this -> columns + $ columns ; } else { // add column to join $ joins = [ ] ; foreach ( $ this -> joins -> getJoins ( ) as $ join ) { if ( $ join [ 'name' ] == $ joinName || in_array ( $ joinName , array_keys ( $ join [ 'name' ] ) ) ) { $ join [ 'columns' ] += $ columns ; } $ joins [ ] = $ join ; } $ this -> joins -> reset ( ) ; foreach ( $ joins as $ join ) { parent :: join ( $ join [ 'name' ] , $ join [ 'on' ] , $ join [ 'columns' ] , $ join [ 'type' ] ) ; } } }
Add columns to the statement
@param $columns Array of columns (@see Select::columns())
@param $joinName The name of the join to which the columns belong
Add columns to the statement