public function addLocale(Locale $locale)
    {
        if (isset($this->localeCollection[(string)$locale])) {
            return false;
        }

        // We need to invalidate the parent's array as it could be inaccurate
        $this->localeParentCollection = [];

        $this->localeCollection[(string)$locale] = $locale;
        return true;
    }
public function addLocale(Locale $locale)
    {
        if (isset($this->localeCollection[(string)$locale])) {
            return false;
        }

        // We need to invalidate the parent's array as it could be inaccurate
        $this->localeParentCollection = [];

        $this->localeCollection[(string)$locale] = $locale;
        return true;
    }
public function addLocale ( Locale $ locale ) { if ( isset ( $ this -> localeCollection [ ( string ) $ locale ] ) ) { return false ; } // We need to invalidate the parent's array as it could be inaccurate $ this -> localeParentCollection = [ ] ; $ this -> localeCollection [ ( string ) $ locale ] = $ locale ; return true ; }
Adds a locale to the collection.

@param Locale $locale The Locale to be inserted
@return boolean false when same locale was already inserted before
Adds a locale to the collection .