Creates a new ObjectPathMapping and stores it in the repository

@param string $pathSegment
@param string|integer $identifier
@return void
340130
protected function storeObjectPathMapping($pathSegment, $identifier)
    {
        $objectPathMapping = new ObjectPathMapping();
        $objectPathMapping->setObjectType($this->objectType);
        $objectPathMapping->setUriPattern($this->getUriPattern());
        $objectPathMapping->setPathSegment($pathSegment);
        $objectPathMapping->setIdentifier($identifier);
        $this->objectPathMappingRepository->add($objectPathMapping);
        $this->objectPathMappingRepository->persistEntities();
    }
932165
public function write(string $identifier, MigrationList $executedMigrations): void
    {
        $exchange = $this->settings['exchange'];
        $client = $this->connector->getConnection();
        $uri = sprintf('/api/bindings/%1$s/e/%2$s/e/%2$s', $this->getVhost(), $exchange);

        // delete existing migration list entries before rewriting
        foreach ($this->loadMigrations() as $migration) {
            $client->delete($uri.'/'.$migration['properties_key']);
        }

        foreach ($executedMigrations as $migration) {
            $client->post($uri, [
                'body' => json_encode([
                    'routing_key' => $identifier,
                    'arguments' => $migration->toNative()
                ])
            ]);
        }
    }
388129
public static function replaceSegment($uri, int $offset, $segment)
    {
        $uri = self::filterUri($uri);

        return self::normalizePath($uri, (new HierarchicalPath($uri->getPath()))->withSegment($offset, $segment));
    }
399124
public function insertSection($name, $identifier)
    {
        try {
            return $this->innerGateway->insertSection($name, $identifier);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
582695
protected function getPathRev($identifier)
    {
        $path = $identifier;
        $rev = '';

        preg_match('{^(.+?)(@\d+)?/$}', $identifier, $match);

        if (!empty($match[2])) {
            $path = $match[1];
            $rev = $match[2];
        }

        return array($path, $rev);
    }
543487
public void addSegment(Segment segment, boolean bStartNewPath) {
		mergeVertexDescription(segment.getDescription());
		if (segment.getType() == Type.Line) {
			Point point = new Point();
			if (bStartNewPath || isEmpty()) {
				segment.queryStart(point);
				startPath(point);
			}

			segment.queryEnd(point);
			lineTo(point);
		} else {
			throw GeometryException.GeometryInternalError();
		}
	}
464894
private function findRoute(array $pathSegments = null) {

	    if(!count($this->routes)) {
	        throw new ApplicationException('Routing aborted: No routes defined.');
        }

		// if no page given try to get the first from list

		if(empty($pathSegments)) {

			return reset($this->routes);
		}

		$pathToCheck	= implode('/', $pathSegments);
		$requestMethod	= Request::createFromGlobals()->getMethod();

		/* @var Route $foundRoute */

		$foundRoute = null;

        /* @var Route $default */

		$default = null;

		// iterate over routes and try to find the "best" match

        /* @var Route $route */

		foreach($this->routes as $route) {

			// keep default route as fallback, when no match is found

			if($route->getRouteId() === 'default') {
				$default = $route;
			}

			// pick route only when request method requirement is met

			if(
				preg_match('~^' . $route->getMatchExpression() . '$~', $pathToCheck) &&
				$route->allowsRequestMethod($requestMethod)
			) {

				// if no route was found yet, pick this first match

				if(!isset($foundRoute)) {
                    $foundRoute = $route;
                    continue;
                }

                // prefer route which is more specific with request methods

                if(count($route->getRequestMethods()) > count($foundRoute->getRequestMethods())) {
                    continue;
                }

                // a route with less (or no) placeholders is preferred over one with placeholders

                if(count($route->getPlaceholderNames()) > count($foundRoute->getPlaceholderNames())) {
                    continue;
                }

                // if a route has been found previously, choose the more "precise" and/or later one
                // choose the route with more satisfied placeholders
                // @todo could be optimized

                $foundRouteSatisfiedPlaceholderCount = count($this->getSatisfiedPlaceholders($foundRoute, $pathToCheck));
                $routeSatisfiedPlaceholderCount = count($this->getSatisfiedPlaceholders($route, $pathToCheck));

                if (
                    ($routeSatisfiedPlaceholderCount - count($route->getPlaceholderNames())) < ($foundRouteSatisfiedPlaceholderCount - count($foundRoute->getPlaceholderNames()))
                ) {
                    continue;
                }
                if (
                    ($routeSatisfiedPlaceholderCount - count($route->getPlaceholderNames())) === ($foundRouteSatisfiedPlaceholderCount - count($foundRoute->getPlaceholderNames())) &&
                    count($route->getPlaceholderNames()) > count($foundRoute->getPlaceholderNames())
                ) {
                    continue;
                }

                $foundRoute = $route;

			}
		}

		// return "normal" route, if found

		if(isset($foundRoute)) {
			return $foundRoute;
		}

		// return default route as fallback (if available)

		return $default;
	}
275006
public function bindScopeIdentifiers(int $identifier, iterable $scopeIdentifiers): void
    {
        try {
            $schema = $this->getDatabaseSchema();
            $this->createBelongsToManyRelationship(
                $identifier,
                $scopeIdentifiers,
                $schema->getTokensScopesTable(),
                $schema->getTokensScopesTokenIdentityColumn(),
                $schema->getTokensScopesScopeIdentityColumn()
            );
        } catch (RepositoryException $exception) {
            $message = 'Binding token scopes failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
573597
public void moveSegmentOut(final String sequenceName, final List<SegmentIdWithShardSpec> identifiers)
  {
    synchronized (segments) {
      final SegmentsForSequence activeSegmentsForSequence = segments.get(sequenceName);
      if (activeSegmentsForSequence == null) {
        throw new ISE("WTF?! Asked to remove segments for sequenceName[%s] which doesn't exist...", sequenceName);
      }

      for (final SegmentIdWithShardSpec identifier : identifiers) {
        log.info("Moving segment[%s] out of active list.", identifier);
        final long key = identifier.getInterval().getStartMillis();
        final SegmentsOfInterval segmentsOfInterval = activeSegmentsForSequence.get(key);
        if (segmentsOfInterval == null ||
            segmentsOfInterval.getAppendingSegment() == null ||
            !segmentsOfInterval.getAppendingSegment().getSegmentIdentifier().equals(identifier)) {
          throw new ISE("WTF?! Asked to remove segment[%s] that didn't exist...", identifier);
        }
        segmentsOfInterval.finishAppendingToCurrentActiveSegment(SegmentWithState::finishAppending);
      }
    }
  }
387349
protected function createParsedIdentifier(SchemaIdentifierInterface $identifier): ParserIdentifierInterface
    {
        return $this->factory->createParsedIdentifier($this->position, $identifier);
    }
316748
public void addPathElement(String pathElement) throws BuildException {
        File pathComponent = project != null ? project.resolveFile(pathElement) : new File(
                pathElement);
        try {
            addPathFile(pathComponent);
        } catch (IOException e) {
            throw new BuildException(e);
        }
    }
1115217
protected function _setPathSegmentSeparator($separator)
    {
        if (
            !($separator instanceof Stringable) &&
            !is_string($separator) &&
            !is_null($separator)
        ) {
            throw $this->_createInvalidArgumentException($this->__('Invalid path segment separator'), null, null, $separator);
        }

        $this->pathSegmentSeparator = $separator;
    }
1119954
protected void _beforeNewSegment(int resizeBy) {
		// Called for each new segment being added.
		if (m_bPathStarted) {
			_initPathStartPoint();// make sure the m_movetoPoint exists and has
									// right vertex description

			// The new path is started. Need to grow m_parts and m_pathFlags.
			if (m_paths == null) {
				m_paths = (AttributeStreamOfInt32) AttributeStreamBase
						.createIndexStream(2);
				m_paths.write(0, 0);
				m_pathFlags = (AttributeStreamOfInt8) AttributeStreamBase
						.createByteStream(2, (byte) 0);
			} else {
				// _ASSERT(m_parts.size() >= 2);
				m_paths.resize(m_paths.size() + 1, 0);
				m_pathFlags.resize(m_pathFlags.size() + 1, 0);
			}

			if (m_bPolygon) {
				// Mark the path as closed
				m_pathFlags.write(m_pathFlags.size() - 2,
						(byte) PathFlags.enumClosed);
			}

			resizeBy++; // +1 for the StartPath point.
		}

		int oldcount = m_pointCount;
		m_paths.write(m_paths.size() - 1, m_pointCount + resizeBy); // The
																	// NotifyModified
																	// will
																	// update
																	// the
																	// m_pointCount
																	// with this
																	// value.
		_resizeImpl(oldcount + resizeBy);
		m_pathFlags.write(m_paths.size() - 1, (byte) 0);

		if (m_bPathStarted) {
			setPointByVal(oldcount, m_moveToPoint);// setPoint(oldcount,
													// m_moveToPoint); //finally
													// set the start point to
													// the geometry
			m_bPathStarted = false;
		}
	}
1102846
@Override
	public void add(int index, ST segment) {
		if (index < 0 || index > this.segmentList.size()) {
			throw new IndexOutOfBoundsException();
		}
		// The path is empty, so that the segment is the first one.
		if (this.segmentList.isEmpty()) {
			if (this.segmentList.add(segment)) {
				this.startingPoint = segment.getBeginPoint();
				this.endingPoint = segment.getEndPoint();
				this.length += segment.getLength();
				return;
			}
			throw new IllegalArgumentException();
		}

		// Detect the candidates to the connection
		final PT candidate;

		this.isReversable = false;

		if (index < this.segmentList.size()) {
			candidate = getStartingPointFor(index);
		} else {
			candidate = this.endingPoint;
		}

		// Check the connection validity
		if (candidate != null) {
			final PT first = segment.getBeginPoint();
			final PT last = segment.getEndPoint();
			if (index == 0 && (candidate.equals(first) || candidate.equals(last))) {
				this.segmentList.add(0, segment);
				this.startingPoint = segment.getOtherSidePoint(this.startingPoint);
				this.length += segment.getLength();
				return;
			} else if (index == this.segmentList.size() && (candidate.equals(first) || candidate.equals(last))) {
				this.segmentList.add(segment);
				this.endingPoint = segment.getOtherSidePoint(this.endingPoint);
				this.length += segment.getLength();
				return;
			} else if (candidate.equals(first) || candidate.equals(last)) {
				this.segmentList.add(index, segment);
				this.length += segment.getLength();
				return;
			}
		}

		throw new IllegalArgumentException();
	}
917261
function(path_segments) {

		var namespace,
			segment_name,
			count = path_segments.length,
			i = 1;

		if (!count) Lava.t("ClassManager: class names must include a namespace, even for global classes.");
		if (!(path_segments[0] in this._root)) Lava.t("[ClassManager] namespace is not registered: " + path_segments[0]);
		namespace = this._root[path_segments[0]];

		for (; i < count; i++) {

			segment_name = path_segments[i];

			if (!(segment_name in namespace)) {

				namespace[segment_name] = {};

			}

			namespace = namespace[segment_name];

		}

		return namespace;

	}
667270
private Segment createMappedSegment(SegmentDescriptor descriptor) {
    File segmentFile = SegmentFile.createSegmentFile(name, storage.directory(), descriptor.id(), descriptor.version());
    Buffer buffer = MappedBuffer.allocate(segmentFile, Math.min(DEFAULT_BUFFER_SIZE, descriptor.maxSegmentSize()), Integer.MAX_VALUE);
    descriptor.copyTo(buffer);
    Segment segment = new Segment(new SegmentFile(segmentFile), buffer.slice(), descriptor, createIndex(descriptor), new OffsetPredicate(), serializer.clone(), this);
    LOGGER.debug("Created segment: {}", segment);
    return segment;
  }
1289284
public function initSegment($segment, $configId = false)
    {
        if (!count($segment->getOverviews()->toArray())) {
            if ($configId) {
                $config = $this->getEntityManager()->getRepository('KunstmaanDashboardBundle:AnalyticsConfig')->find($configId);
            } else {
                $config = $this->getEntityManager()->getRepository('KunstmaanDashboardBundle:AnalyticsConfig')->findFirst();
            }
            $this->getEntityManager()->getRepository('KunstmaanDashboardBundle:AnalyticsOverview')->addOverviews($config, $segment);
        }
    }