src/Versioned.php
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null)
    {
        // Ensure query mode exists
        $versionedMode = $dataQuery->getQueryParam('Versioned.mode');
        if (!$versionedMode) {
            return;
        }
        switch ($versionedMode) {
            case 'stage':
                $this->augmentSQLStage($query, $dataQuery);
                break;
            case 'stage_unique':
                $this->augmentSQLStageUnique($query, $dataQuery);
                break;
            case 'archive':
                $this->augmentSQLVersionedArchive($query, $dataQuery);
                break;
            case 'latest_version_single':
                $this->augmentSQLVersionedLatestSingle($query, $dataQuery);
                break;
            case 'latest_versions':
                $this->augmentSQLVersionedLatest($query);
                break;
            case 'version':
                $this->augmentSQLVersionedVersion($query, $dataQuery);
                break;
            case 'all_versions':
                $this->augmentSQLVersionedAll($query);
                break;
            default:
                throw new InvalidArgumentException("Bad value for query parameter Versioned.mode: {$versionedMode}");
        }
    }
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null)
    {
        // Ensure query mode exists
        $versionedMode = $dataQuery->getQueryParam('Versioned.mode');
        if (!$versionedMode) {
            return;
        }
        switch ($versionedMode) {
            case 'stage':
                $this->augmentSQLStage($query, $dataQuery);
                break;
            case 'stage_unique':
                $this->augmentSQLStageUnique($query, $dataQuery);
                break;
            case 'archive':
                $this->augmentSQLVersionedArchive($query, $dataQuery);
                break;
            case 'latest_version_single':
                $this->augmentSQLVersionedLatestSingle($query, $dataQuery);
                break;
            case 'latest_versions':
                $this->augmentSQLVersionedLatest($query);
                break;
            case 'version':
                $this->augmentSQLVersionedVersion($query, $dataQuery);
                break;
            case 'all_versions':
                $this->augmentSQLVersionedAll($query);
                break;
            default:
                throw new InvalidArgumentException("Bad value for query parameter Versioned.mode: {$versionedMode}");
        }
    }
public function augmentSQL ( SQLSelect $ query , DataQuery $ dataQuery = null ) { // Ensure query mode exists $ versionedMode = $ dataQuery -> getQueryParam ( 'Versioned.mode' ) ; if ( ! $ versionedMode ) { return ; } switch ( $ versionedMode ) { case 'stage' : $ this -> augmentSQLStage ( $ query , $ dataQuery ) ; break ; case 'stage_unique' : $ this -> augmentSQLStageUnique ( $ query , $ dataQuery ) ; break ; case 'archive' : $ this -> augmentSQLVersionedArchive ( $ query , $ dataQuery ) ; break ; case 'latest_version_single' : $ this -> augmentSQLVersionedLatestSingle ( $ query , $ dataQuery ) ; break ; case 'latest_versions' : $ this -> augmentSQLVersionedLatest ( $ query ) ; break ; case 'version' : $ this -> augmentSQLVersionedVersion ( $ query , $ dataQuery ) ; break ; case 'all_versions' : $ this -> augmentSQLVersionedAll ( $ query ) ; break ; default : throw new InvalidArgumentException ( "Bad value for query parameter Versioned.mode: {$versionedMode}" ) ; } }
Augment the the SQLSelect that is created by the DataQuery

See {@see augmentLazyLoadFields} for lazy-loading applied prior to this.

@param SQLSelect $query
@param DataQuery $dataQuery
@throws InvalidArgumentException
Augment the the SQLSelect that is created by the DataQuery