protected function addAssetsFromOtherStages(AssetManipulationList $manipulation)
    {
        // Skip unversioned or unsaved assets
        if (!$this->isVersioned() || !$this->owner->isInDB()) {
            return;
        }

        // Unauthenticated member to use for checking visibility
        $baseClass = $this->owner->baseClass();
        $baseTable = $this->owner->baseTable();
        $filter = array(
            Convert::symbol2sql("{$baseTable}.ID") => $this->owner->ID,
        );
        $stages = $this->owner->getVersionedStages(); // {@see Versioned::getVersionedStages}
        foreach ($stages as $stage) {
            // Skip current stage; These should be handled explicitly
            if ($stage === Versioned::get_stage()) {
                continue;
            }

            // Check if record exists in this stage
            $record = Versioned::get_one_by_stage($baseClass, $stage, $filter);
            if (!$record) {
                continue;
            }

            // Check visibility of this record, and record all attached assets
            $state = $this->getRecordState($record);
            $this->addAssetsFromRecord($manipulation, $record, $state);
        }
    }
protected function addAssetsFromOtherStages(AssetManipulationList $manipulation)
    {
        // Skip unversioned or unsaved assets
        if (!$this->isVersioned() || !$this->owner->isInDB()) {
            return;
        }

        // Unauthenticated member to use for checking visibility
        $baseClass = $this->owner->baseClass();
        $baseTable = $this->owner->baseTable();
        $filter = array(
            Convert::symbol2sql("{$baseTable}.ID") => $this->owner->ID,
        );
        $stages = $this->owner->getVersionedStages(); // {@see Versioned::getVersionedStages}
        foreach ($stages as $stage) {
            // Skip current stage; These should be handled explicitly
            if ($stage === Versioned::get_stage()) {
                continue;
            }

            // Check if record exists in this stage
            $record = Versioned::get_one_by_stage($baseClass, $stage, $filter);
            if (!$record) {
                continue;
            }

            // Check visibility of this record, and record all attached assets
            $state = $this->getRecordState($record);
            $this->addAssetsFromRecord($manipulation, $record, $state);
        }
    }
protected function addAssetsFromOtherStages ( AssetManipulationList $ manipulation ) { // Skip unversioned or unsaved assets if ( ! $ this -> isVersioned ( ) || ! $ this -> owner -> isInDB ( ) ) { return ; } // Unauthenticated member to use for checking visibility $ baseClass = $ this -> owner -> baseClass ( ) ; $ baseTable = $ this -> owner -> baseTable ( ) ; $ filter = array ( Convert :: symbol2sql ( "{$baseTable}.ID" ) => $ this -> owner -> ID , ) ; $ stages = $ this -> owner -> getVersionedStages ( ) ; // {@see Versioned::getVersionedStages} foreach ( $ stages as $ stage ) { // Skip current stage; These should be handled explicitly if ( $ stage === Versioned :: get_stage ( ) ) { continue ; } // Check if record exists in this stage $ record = Versioned :: get_one_by_stage ( $ baseClass , $ stage , $ filter ) ; if ( ! $ record ) { continue ; } // Check visibility of this record, and record all attached assets $ state = $ this -> getRecordState ( $ record ) ; $ this -> addAssetsFromRecord ( $ manipulation , $ record , $ state ) ; } }
Checks all stages other than the current stage, and check the visibility
of assets attached to those records.

@param AssetManipulationList $manipulation Set of manipulations to add assets to
Checks all stages other than the current stage and check the visibility of assets attached to those records .