example/User.php
public function getVisa($country_code)
    {
        /** @var Visa $visa */
        $visas = [];
        foreach ($this->visas as $visa) {
            if ($visa->getCountry()->getCode() == $country_code) {
                $visas[] = $visa;
            }
        }
        return $visas;
    }
public function getVisa($country_code)
    {
        /** @var Visa $visa */
        $visas = [];
        foreach ($this->visas as $visa) {
            if ($visa->getCountry()->getCode() == $country_code) {
                $visas[] = $visa;
            }
        }
        return $visas;
    }
public function getVisa ( $ country_code ) { /** @var Visa $visa */ $ visas = [ ] ; foreach ( $ this -> visas as $ visa ) { if ( $ visa -> getCountry ( ) -> getCode ( ) == $ country_code ) { $ visas [ ] = $ visa ; } } return $ visas ; }
Return a specific visa

@param Visa $visa

@return mixed|null
Return a specific visa