mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-29 06:26:22 +00:00
601 B
601 B
id | title |
---|---|
ba952b1d-0609-4bc6-94b9-0192df3bf4f2 | Timezone Constraint |
Syntax
// src/Entity/UserSettings.php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class UserSettings
{
/**
* @Assert\Timezone
*/
protected $timezone;
}
// Consider valid only the timezones from countries in America continent
/** @Assert\Timezone(zone=\DateTimeZone::AMERICA) */
protected $timezone;
// Consider valid only the Chinese timezones
/** @Assert\Timezone(zone=\DateTimeZone::PER_COUNTRY, countryCode="CN") */
protected $timezone;