/**
  * {@inheritdoc}
  */
 public function findAssetMappings(Expression $expr)
 {
     $bindings = $this->discoveryManager->findBindings($this->exprBuilder->buildExpression($expr));
     $mappings = array();
     foreach ($bindings as $binding) {
         $mappings[] = $this->bindingToMapping($binding);
     }
     return $mappings;
 }
예제 #2
0
 /**
  * @param string $uuidPrefix
  *
  * @return BindingDescriptor
  */
 private function getBindingByUuidPrefix($uuidPrefix)
 {
     $expr = Expr::startsWith($uuidPrefix, BindingDescriptor::UUID);
     $bindings = $this->discoveryManager->findBindings($expr);
     if (0 === count($bindings)) {
         throw new RuntimeException(sprintf('The binding "%s" does not exist.', $uuidPrefix));
     }
     if (count($bindings) > 1) {
         throw new RuntimeException(sprintf('More than one binding matches the UUID prefix "%s".', $uuidPrefix));
     }
     return reset($bindings);
 }