public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null)
    {
        $stage = Versioned::get_stage();

        if (Controller::has_curr() && Controller::curr() instanceof LeftAndMain) {
            return;
        }

        if ($stage == 'Live' || !Permission::check('VIEW_DRAFT_CONTENT')) {
            $query->addWhere(sprintf(
                '"PublishDate" < \'%s\'',
                Convert::raw2sql(DBDatetime::now())
            ));
        }
    }
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null)
    {
        $stage = Versioned::get_stage();

        if (Controller::has_curr() && Controller::curr() instanceof LeftAndMain) {
            return;
        }

        if ($stage == 'Live' || !Permission::check('VIEW_DRAFT_CONTENT')) {
            $query->addWhere(sprintf(
                '"PublishDate" < \'%s\'',
                Convert::raw2sql(DBDatetime::now())
            ));
        }
    }
public function augmentSQL ( SQLSelect $ query , DataQuery $ dataQuery = null ) { $ stage = Versioned :: get_stage ( ) ; if ( Controller :: has_curr ( ) && Controller :: curr ( ) instanceof LeftAndMain ) { return ; } if ( $ stage == 'Live' || ! Permission :: check ( 'VIEW_DRAFT_CONTENT' ) ) { $ query -> addWhere ( sprintf ( '"PublishDate" < \'%s\'' , Convert :: raw2sql ( DBDatetime :: now ( ) ) ) ) ; } }
Augment queries so that we don't fetch unpublished articles.

@param SQLSelect $query
@param DataQuery $query
Augment queries so that we don t fetch unpublished articles .