/** * Override to ensure the $attributeName is a single value and also to resolve the max name length. * @param string $modelClassName * @param string $attributeName */ public function __construct($modelClassName, $attributeName) { parent::__construct($modelClassName, $attributeName); assert('is_string($attributeName)'); $attributeModelClassName = $this->attributeModelClassName; $model = new $attributeModelClassName(false); assert('$model->isAttribute("name")'); $this->maxNameLength = StringValidatorHelper::getMaxLengthByModelAndAttributeName($model, 'name'); $this->messageCountData[static::NEW_NAME_TO0_LONG] = 0; }
/** * Override to ensure the attribute is 'id'. * @param string $modelClassName * @param string $attributeName */ public function __construct($modelClassName, $attributeName) { parent::__construct($modelClassName, $attributeName); assert('$this->attributeName == "id"'); }