Example #1
0
 /**
  * Removes extension from path.
  * @param string $path
  * @return string
  */
 static function RemoveExtension($path)
 {
     $ext = self::Extension($path);
     if ($ext) {
         $newLength = System\String::Length($path) - System\String::Length($ext) - 1;
         //dot length = 1!
         return System\String::Start($path, $newLength);
     }
     return $path;
 }
 function ClassName($tableName)
 {
     $result = $tableName;
     foreach ($this->prefixNamespaces as $prefix => $namespace) {
         if ($prefix && System\String::StartsWith($prefix, $result, !$this->prefixesCaseSensitive)) {
             $result = System\String::Part($result, System\String::Length($prefix));
             break;
         }
     }
     return $this->ToCamelCase($result);
 }
 function Check($value)
 {
     $value = (string) $value;
     if ($this->trimValue) {
         $value = trim($value);
     }
     $length = System\String::Length($value);
     if ($this->IsTooShort($length)) {
         $this->error = self::TooShort;
     } else {
         if ($this->IsTooLong($length)) {
             $this->error = self::TooLong;
         } else {
             $this->error = '';
         }
     }
     return $this->error == '';
 }