src/Extension/FluentVersionedExtension.php
protected function isLocalisedInStage($stage, $locale = null)
    {
        // Get locale
        if (!$locale) {
            $locale = FluentState::singleton()->getLocale();

            // Potentially no Locales have been created in the system yet.
            if (!$locale) {
                return false;
            }
        }

        // Get table
        $baseTable = $this->owner->baseTable();
        $table = $this->getLocalisedTable($baseTable);
        if ($stage === Versioned::LIVE) {
            $table .= self::SUFFIX_LIVE;
        }

        // Check for a cached item in the full list of all objects. These are populated optimistically.
        if (isset(static::$idsInLocaleCache[$locale][$table][$this->owner->ID])) {
            return (bool) static::$idsInLocaleCache[$locale][$table][$this->owner->ID];
        }

        if (!empty(static::$idsInLocaleCache[$locale][$table]['_complete'])) {
            return false;
        }

        // Set cache and return
        return static::$idsInLocaleCache[$locale][$table][$this->owner->ID]
            = $this->findRecordInLocale($locale, $table, $this->owner->ID);
    }
protected function isLocalisedInStage($stage, $locale = null)
    {
        // Get locale
        if (!$locale) {
            $locale = FluentState::singleton()->getLocale();

            // Potentially no Locales have been created in the system yet.
            if (!$locale) {
                return false;
            }
        }

        // Get table
        $baseTable = $this->owner->baseTable();
        $table = $this->getLocalisedTable($baseTable);
        if ($stage === Versioned::LIVE) {
            $table .= self::SUFFIX_LIVE;
        }

        // Check for a cached item in the full list of all objects. These are populated optimistically.
        if (isset(static::$idsInLocaleCache[$locale][$table][$this->owner->ID])) {
            return (bool) static::$idsInLocaleCache[$locale][$table][$this->owner->ID];
        }

        if (!empty(static::$idsInLocaleCache[$locale][$table]['_complete'])) {
            return false;
        }

        // Set cache and return
        return static::$idsInLocaleCache[$locale][$table][$this->owner->ID]
            = $this->findRecordInLocale($locale, $table, $this->owner->ID);
    }
protected function isLocalisedInStage ( $ stage , $ locale = null ) { // Get locale if ( ! $ locale ) { $ locale = FluentState :: singleton ( ) -> getLocale ( ) ; // Potentially no Locales have been created in the system yet. if ( ! $ locale ) { return false ; } } // Get table $ baseTable = $ this -> owner -> baseTable ( ) ; $ table = $ this -> getLocalisedTable ( $ baseTable ) ; if ( $ stage === Versioned :: LIVE ) { $ table .= self :: SUFFIX_LIVE ; } // Check for a cached item in the full list of all objects. These are populated optimistically. if ( isset ( static :: $ idsInLocaleCache [ $ locale ] [ $ table ] [ $ this -> owner -> ID ] ) ) { return ( bool ) static :: $ idsInLocaleCache [ $ locale ] [ $ table ] [ $ this -> owner -> ID ] ; } if ( ! empty ( static :: $ idsInLocaleCache [ $ locale ] [ $ table ] [ '_complete' ] ) ) { return false ; } // Set cache and return return static :: $ idsInLocaleCache [ $ locale ] [ $ table ] [ $ this -> owner -> ID ] = $ this -> findRecordInLocale ( $ locale , $ table , $ this -> owner -> ID ) ; }
Check to see whether or not a record exists for a specific Locale in a specific stage.

@param string $stage Version stage
@param string $locale Locale to check. Defaults to current locale.
@return bool
Check to see whether or not a record exists for a specific Locale in a specific stage .