src/wcmf/lib/persistence/ObjectId.php
private static function parseOidString($oid) {
    if (strlen($oid) == 0) {
      return null;
    }

    $oidParts = preg_split(self::getDelimiterPattern(), $oid);
    if (sizeof($oidParts) < 2) {
      return null;
    }

    if (self::$idPattern == null) {
      self::$idPattern = '/^[0-9]*$|^'.self::$dummyIdPattern.'$/';
    }

    // get the ids from the oid
    $ids = [];
    $nextPart = array_pop($oidParts);
    while($nextPart !== null && preg_match(self::$idPattern, $nextPart) == 1) {
      $intNextPart = (int)$nextPart;
      if ($nextPart == (string)$intNextPart) {
        $ids[] = $intNextPart;
      }
      else {
        $ids[] = $nextPart;
      }
      $nextPart = array_pop($oidParts);
    }
    $ids = array_reverse($ids);

    // get the type
    $type = $nextPart;

    // get the prefix
    $prefix = join(self::DELIMITER, $oidParts);

    return [
      'type' => $type,
      'id' => $ids,
      'prefix' => $prefix
    ];
  }
private static function parseOidString($oid) {
    if (strlen($oid) == 0) {
      return null;
    }

    $oidParts = preg_split(self::getDelimiterPattern(), $oid);
    if (sizeof($oidParts) < 2) {
      return null;
    }

    if (self::$idPattern == null) {
      self::$idPattern = '/^[0-9]*$|^'.self::$dummyIdPattern.'$/';
    }

    // get the ids from the oid
    $ids = [];
    $nextPart = array_pop($oidParts);
    while($nextPart !== null && preg_match(self::$idPattern, $nextPart) == 1) {
      $intNextPart = (int)$nextPart;
      if ($nextPart == (string)$intNextPart) {
        $ids[] = $intNextPart;
      }
      else {
        $ids[] = $nextPart;
      }
      $nextPart = array_pop($oidParts);
    }
    $ids = array_reverse($ids);

    // get the type
    $type = $nextPart;

    // get the prefix
    $prefix = join(self::DELIMITER, $oidParts);

    return [
      'type' => $type,
      'id' => $ids,
      'prefix' => $prefix
    ];
  }
private static function parseOidString ( $ oid ) { if ( strlen ( $ oid ) == 0 ) { return null ; } $ oidParts = preg_split ( self :: getDelimiterPattern ( ) , $ oid ) ; if ( sizeof ( $ oidParts ) < 2 ) { return null ; } if ( self :: $ idPattern == null ) { self :: $ idPattern = '/^[0-9]*$|^' . self :: $ dummyIdPattern . '$/' ; } // get the ids from the oid $ ids = [ ] ; $ nextPart = array_pop ( $ oidParts ) ; while ( $ nextPart !== null && preg_match ( self :: $ idPattern , $ nextPart ) == 1 ) { $ intNextPart = ( int ) $ nextPart ; if ( $ nextPart == ( string ) $ intNextPart ) { $ ids [ ] = $ intNextPart ; } else { $ ids [ ] = $ nextPart ; } $ nextPart = array_pop ( $ oidParts ) ; } $ ids = array_reverse ( $ ids ) ; // get the type $ type = $ nextPart ; // get the prefix $ prefix = join ( self :: DELIMITER , $ oidParts ) ; return [ 'type' => $ type , 'id' => $ ids , 'prefix' => $ prefix ] ; }
Parse the given object id string into it's parts
@param $oid The string
@return Associative array with keys 'type', 'id', 'prefix'
Parse the given object id string into it s parts