public function setLocation($location)
    {
        Validate::canCastAsString($location, 'location');
        Validate::isTrue(
            $location == LocationMode::PRIMARY_ONLY ||
            $location == LocationMode::SECONDARY_ONLY ||
            $location == '',
            sprintf(
                Resources::INVALID_VALUE_MSG,
                'location',
                LocationMode::PRIMARY_ONLY . ' or ' . LocationMode::SECONDARY_ONLY
            )
        );

        $this->location = $location;
    }
public function setLocation($location)
    {
        Validate::canCastAsString($location, 'location');
        Validate::isTrue(
            $location == LocationMode::PRIMARY_ONLY ||
            $location == LocationMode::SECONDARY_ONLY ||
            $location == '',
            sprintf(
                Resources::INVALID_VALUE_MSG,
                'location',
                LocationMode::PRIMARY_ONLY . ' or ' . LocationMode::SECONDARY_ONLY
            )
        );

        $this->location = $location;
    }
public function setLocation ( $ location ) { Validate :: canCastAsString ( $ location , 'location' ) ; Validate :: isTrue ( $ location == LocationMode :: PRIMARY_ONLY || $ location == LocationMode :: SECONDARY_ONLY || $ location == '' , sprintf ( Resources :: INVALID_VALUE_MSG , 'location' , LocationMode :: PRIMARY_ONLY . ' or ' . LocationMode :: SECONDARY_ONLY ) ) ; $ this -> location = $ location ; }
Setter for location

@param string $location the location to be set.
Setter for location