예제 #1
0
 /**
  * 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);
 }
예제 #2
0
 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);
 }
예제 #4
0
 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;
 }
예제 #5
0
 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);
 }