Exemple #1
0
 /**
  * Set homepage URL
  * 
  * This function is simple setter but it will check if protocol is specified for given URL. If it is not then 
  * http will be used. Supported protocols are http and https for this type or URL
  *
  * @param string $value
  * @return null
  */
 function setHomepage($value)
 {
     if (trim($value) == '') {
         return parent::setHomepage('');
     }
     // if
     $check_value = strtolower($value);
     if (!str_starts_with($check_value, 'http://') && !str_starts_with($check_value, 'https://')) {
         return parent::setHomepage('http://' . $value);
     } else {
         return parent::setHomepage($value);
     }
     // if
 }