/** * Sets description if it is valid, return the n first characters if it is too long * @param $description */ public function setDescription($description) { $this->description = ModelValidation::getValidDescription($description); }
public function setUrl($url) { $this->url = ModelValidation::getValidURL($url); }
/** * Sets name if it is valid, return the n first characters if it is too long * @param $name */ public function setName($name) { $this->name = ModelValidation::getValidName($name); }
protected function setStringProperty($field, $value, $max_length, $error_massage_field_name) { $message = null; if (strlen($value) > $max_length) { $value = ModelValidation::getValidString($value, $max_length); $message = "{$error_massage_field_name} is too long. {$error_massage_field_name} set to: {$value}"; } $this->{$field} = $value; return $message; }
public function setComment($comment) { $this->comment = ModelValidation::getValidComment($comment); }
public function setAbbreviation($abbreviation) { $this->abbreviation = ModelValidation::getValidAbbreviation($abbreviation); }
/** * Sets value if it is valid, return the n first characters if it is too long * @param $value */ public function setValue($value) { $this->value = ModelValidation::getValidFieldValue($value); }
public function setInternalId($internal_id) { $this->internal_id = ModelValidation::getValidInternalId($internal_id); }