Checks if a Location object matches.

@param \eZ\Publish\API\Repository\Values\Content\Location $location

@return bool
516985
public function matchLocation(Location $location)
    {
        $section = $this->repository->sudo(
            function (Repository $repository) use ($location) {
                return $repository->getSectionService()->loadSection(
                    $location->getContentInfo()->sectionId
                );
            }
        );

        return isset($this->values[$section->identifier]);
    }
614342
public function post($location, $body)
    {
        curl_setopt($this->curl, CURLOPT_POST, 1);
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body);
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

        return $this->execute('POST', $location);
    }
413932
public function isMatch(Address $address)
    {
        if (!is_null($address->getBin()) && !is_null($this->bin) && $address->getBin() !== $this->bin) {
            return false;
        }
        if (!is_null($address->getKey()) && !is_null($this->key) && $address->getKey() !== $this->key) {
            return false;
        }
        return true;
    }
1196205
public final function containsLocation( $xOrPoint, int $y = null ) : bool
   {

      $x = $xOrPoint;

      if ( $x instanceof Point )
      {
         $y = $x->y;
         $x = $x->x;
      }
      else if ( \is_integer( $xOrPoint ) )
      {
         $x = $xOrPoint;
      }
      else if ( TypeTool::IsInteger( $xOrPoint ) )
      {
         $x = \intval( $xOrPoint );
      }
      else
      {
         $x = 0;
      }

      if ( ! \is_int( $y ) )
      {
         $y = \intval( $y );
      }

      return (
         (
            (
               ( $this->point->x <= $x )
               &&
               ( $x < ( $this->point->x + $this->size->width ) )
            )
            &&
            ( $this->point->y <= $y )
         )
         &&
         ( $y < ( $this->point->y + $this->size->height ) )
      );

   }
754356
public function setLocation($location) {
    $c = http_response_code();
    $this->_setHeader('Location',$location);
    http_response_code($c);
    return $this;
  }
1166838
public function addLocation(Location $location)
    {
        // If this is the first Location, we can assume it can be the default
        if (!count($this->locations))
        {
            $this->setDefaultLocation($location);
        }

        $this->locations[] = $location;
        $location->setProfile($this);
    }
662616
public static function convertLocationCoordinates(Location $location)
    {
        $coordinates = $location->getCoordinates()->getCoordinates();
        $coordinate = doubleval($coordinates[1]) . '%' . doubleval($coordinates[0]);
        $coordinate = strtr($coordinate, [
            '%'=>',',
            ','=>'.'
        ]);
        return $coordinate;
    }
382921
public function valid()
    {

        $allowedValues = $this->getLocationTypeAllowableValues();
        if (!in_array($this->container['locationType'], $allowedValues)) {
            return false;
        }
        return true;
    }
897937
public static function getMenuNameByLocation($location)
    {
        if(!has_nav_menu($location)) return false;
        $menus = get_nav_menu_locations();
        $menuTitle = wp_get_nav_menu_object($menus[$location])->name;
        return $menuTitle;
    }
832383
protected function checkCategoryRedirect(Location $location): ?RedirectResponse
    {
        $content = $location->content;

        $internalRedirectContent = null;
        if (!$content->getField('internal_redirect')->isEmpty()) {
            $internalRedirectContent = $content->getFieldRelation('internal_redirect');
        }

        $externalRedirectValue = $content->getField('external_redirect')->value;

        if ($internalRedirectContent instanceof Content) {
            if ($internalRedirectContent->contentInfo->mainLocationId !== $location->id) {
                return new RedirectResponse(
                    $this->router->generate($internalRedirectContent),
                    RedirectResponse::HTTP_MOVED_PERMANENTLY
                );
            }
        } elseif ($externalRedirectValue instanceof UrlValue && !$content->getField('external_redirect')->isEmpty()) {
            if (mb_stripos($externalRedirectValue->link, 'http') === 0) {
                return new RedirectResponse($externalRedirectValue->link, RedirectResponse::HTTP_MOVED_PERMANENTLY);
            }

            return new RedirectResponse(
                $this->router->generate($this->getRootLocation()) . trim($externalRedirectValue->link, '/'),
                RedirectResponse::HTTP_MOVED_PERMANENTLY
            );
        }

        return null;
    }
974175
public function isSatisfiedBy($item): bool
    {
        if ($this->copyLimit === -1) {
            return true;
        }

        if ($this->copyLimit === 0) {
            return false;
        }

        $query = new LocationQuery([
            'filter' => new Criterion\Subtree($item->pathString),
        ]);

        $searchResults = $this->searchService->findLocations($query);

        if ($this->copyLimit >= $searchResults->totalCount) {
            return true;
        }

        return false;
    }
823674
public function createLocation(string $location, string $match = null) : Location
    {
        return new Location(new Param($location), is_null($match) ? null : new Param($match));
    }
1351184
public function addLocation(Location $location): void
    {
        if ($this->locations->contains($location)) {
            throw new \InvalidArgumentException(
                    'The same Location cannot be added twice');
        }
        $location->setWarehouse($this);
        $this->locations->add($location);
    }
339525
public function set_read_file($location)
    {
        $this->read_file = $location;
        $read_file_handle = fopen($location, 'r');

        return $this->set_read_stream($read_file_handle);
    }
826574
public function isRedirect($location = null)
    {
        return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->getHeaderLine('Location'));
    }
510402
public function get($location)
    {
        curl_setopt($this->curl, CURLOPT_HTTPGET, true);

        return $this->execute('GET', $location);
    }
1109998
public static function is_iplocation($ip, $location)
	{
		$iplocation = false;
		if ($ip && $location)
		{
			if (!($gdb = self::getGeoDBO()))
			{
				return $iplocation;
			}

			$sql = "SELECT COUNT(*) FROM iplocation WHERE ipfrom <= INET_ATON(" . $gdb->quote($ip) . ") AND ipto >= INET_ATON(" . $gdb->quote($ip) . ") AND LOWER(location) = LOWER(" . $gdb->quote($location) . ")";
			$gdb->setQuery($sql);
			$c = $gdb->loadResult();
			if ($c > 0)
			{
				$iplocation = true;
			}
		}
		return $iplocation;
	}