original_string: protected function validate_path($value) {
  
          // The last item should be the parent ID.
          $id = $this->get('parentid');
          if (substr($value, -(strlen($id) + 2)) != '/' . $id . '/') {
              return new lang_string('invaliddata', 'error');
  
          } else if (!preg_match('@/([0-9]+/)+@', $value)) {
              // The format of the path is not correct.
              return new lang_string('invaliddata', 'error');
          }
  
          return true;
      }
code: protected function validate_path($value) {
  
          // The last item should be the parent ID.
          $id = $this->get('parentid');
          if (substr($value, -(strlen($id) + 2)) != '/' . $id . '/') {
              return new lang_string('invaliddata', 'error');
  
          } else if (!preg_match('@/([0-9]+/)+@', $value)) {
              // The format of the path is not correct.
              return new lang_string('invaliddata', 'error');
          }
  
          return true;
      }
code_tokens: protected function validate_path ( $ value ) { // The last item should be the parent ID. $ id = $ this -> get ( 'parentid' ) ; if ( substr ( $ value , - ( strlen ( $ id ) + 2 ) ) != '/' . $ id . '/' ) { return new lang_string ( 'invaliddata' , 'error' ) ; } else if ( ! preg_match ( '@/([0-9]+/)+@' , $ value ) ) { // The format of the path is not correct. return new lang_string ( 'invaliddata' , 'error' ) ; } return true ; }
docstring: Validate the path.
  
  @param string $value The path.
  @return true|lang_string
docstring_tokens: Validate the path .