visibility = $visibility; } /** * Get the value of the object. * * @return string */ public function get(): string { return $this->visibility; } /** * Cast a value and return a new instance of the class. * * @param string $value Mixed value to cast to class type. * * @return ChannelVisibility * * @throws InvalidValue When an invalid visibility type is provided. */ public static function cast( $value ): ChannelVisibility { return new self( $value ); } /** * Return an array of the values with option labels. * * @return array */ public static function get_value_options(): array { return [ self::SYNC_AND_SHOW => __( 'Sync and show', 'google-listings-and-ads' ), self::DONT_SYNC_AND_SHOW => __( 'Don\'t Sync and show', 'google-listings-and-ads' ), ]; } /** * @return string */ public function __toString(): string { return $this->get(); } }