public function rules()
{
return [
[['field1', 'field2'], 'required', 'on' => 'scenario1'],
[['field3', 'field4'], 'required', 'on' => 'scenario2'],
];
}
/**
* @Assert\Regex('/\d+/')
* @Assert\NotBlank()
* @ORM\Column(name="price", type="integer", length=11)
*/
public $price;
'/^[а-яА-ЯёЁa-zA-Z0-9 ]+$/'
"/^[\w ]+$/u"
'/[\w ]+/u'