Example #1
0
 /**
  * @param string $pattern
  * @param Query  $query
  *
  * @return string
  */
 protected function buildPath($pattern, Query $query)
 {
     $path = $pattern;
     foreach ($query->getConditions() as $parameter => $value) {
         $count = 0;
         $path = str_replace(sprintf('{%s}', $parameter), $value, $path, $count);
         if ($count > 0) {
             $query->removeCondition($parameter);
         }
     }
     return $path;
 }