public function propertiesRules()
    {
        $rules = [];
        $this->ensurePropertiesAttributes();

        if (empty($this->propertiesIds) === false) {
            foreach ($this->propertiesIds as $propertyId) {
                /** @var Property $property */
                $property = Property::findById($propertyId);
                $handler = $property->handler();

                $rules = ArrayHelper::merge($rules, $handler->getValidationRules($property));
                if ($property->isRequired()) {
                    $rules = ArrayHelper::merge($rules, [[$property->key, 'required']]);
                }
            }
        }
        return $rules;
    }