public function inCountries(array $req_countries)
    {
        $countries = new ArrayCollection();

        foreach ($req_countries as $country) {
            if ($country = trim($country) === '') {
                continue;
            }
            if ($countries->contains($country)) {
                continue;
            }

            $countries->add($country);
        }

        if (!$countries->isEmpty()) {
            $this->countries = $countries;
        }

        return $this;
    }
public function inCountries(array $req_countries)
    {
        $countries = new ArrayCollection();

        foreach ($req_countries as $country) {
            if ($country = trim($country) === '') {
                continue;
            }
            if ($countries->contains($country)) {
                continue;
            }

            $countries->add($country);
        }

        if (!$countries->isEmpty()) {
            $this->countries = $countries;
        }

        return $this;
    }
public function inCountries ( array $ req_countries ) { $ countries = new ArrayCollection ( ) ; foreach ( $ req_countries as $ country ) { if ( $ country = trim ( $ country ) === '' ) { continue ; } if ( $ countries -> contains ( $ country ) ) { continue ; } $ countries -> add ( $ country ) ; } if ( ! $ countries -> isEmpty ( ) ) { $ this -> countries = $ countries ; } return $ this ; }
Restrict users by countries

@param array $req_countries

@return $this
Restrict users by countries