public function getLocalizedValue($fieldName, $strict = true, $parseShortCodes = false)
    {
        $localizedField = $this->getLocalizedFieldName($fieldName);

        // ensure that $strict is a boolean value
        $strict = filter_var($strict, FILTER_VALIDATE_BOOLEAN);

        /** @var DBField $value */
        $value = $this->owner->dbObject($localizedField);
        if (!$strict && !$value->exists()) {
            $value = $this->owner->dbObject($fieldName);
        }

        return ($parseShortCodes && $value) ? ShortcodeParser::get_active()->parse($value->getValue()) : $value;
    }
public function getLocalizedValue($fieldName, $strict = true, $parseShortCodes = false)
    {
        $localizedField = $this->getLocalizedFieldName($fieldName);

        // ensure that $strict is a boolean value
        $strict = filter_var($strict, FILTER_VALIDATE_BOOLEAN);

        /** @var DBField $value */
        $value = $this->owner->dbObject($localizedField);
        if (!$strict && !$value->exists()) {
            $value = $this->owner->dbObject($fieldName);
        }

        return ($parseShortCodes && $value) ? ShortcodeParser::get_active()->parse($value->getValue()) : $value;
    }
public function getLocalizedValue ( $ fieldName , $ strict = true , $ parseShortCodes = false ) { $ localizedField = $ this -> getLocalizedFieldName ( $ fieldName ) ; // ensure that $strict is a boolean value $ strict = filter_var ( $ strict , FILTER_VALIDATE_BOOLEAN ) ; /** @var DBField $value */ $ value = $ this -> owner -> dbObject ( $ localizedField ) ; if ( ! $ strict && ! $ value -> exists ( ) ) { $ value = $ this -> owner -> dbObject ( $ fieldName ) ; } return ( $ parseShortCodes && $ value ) ? ShortcodeParser :: get_active ( ) -> parse ( $ value -> getValue ( ) ) : $ value ; }
Get the localized value for a given field.
@param string $fieldName the name of the field without any locale extension. Eg. "Title"
@param boolean $strict if false, this will fallback to the master version of the field!
@param boolean $parseShortCodes whether or not the value should be parsed with the shortcode parser
@return string|DBField
Get the localized value for a given field .