Skip to content
Browse files

added fluent interface to validatorbuilder

  • Loading branch information...
1 parent 69dc85f commit f3bfba97ee0c11ca23e3097231c9e46a04050bd4 @meandmymonkey meandmymonkey committed Aug 23, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 ValidatorBuilder.php
View
26 ValidatorBuilder.php
@@ -81,6 +81,8 @@ class ValidatorBuilder implements ValidatorBuilderInterface
public function addObjectInitializer(ObjectInitializerInterface $initializer)
{
$this->initializers[] = $initializer;
+
+ return $this;
}
/**
@@ -89,6 +91,8 @@ public function addObjectInitializer(ObjectInitializerInterface $initializer)
public function addObjectInitializers(array $initializers)
{
$this->initializers = array_merge($this->initializers, $initializers);
+
+ return $this;
}
/**
@@ -101,6 +105,8 @@ public function addXmlMapping($path)
}
$this->xmlMappings[] = $path;
+
+ return $this;
}
/**
@@ -113,6 +119,8 @@ public function addXmlMappings(array $paths)
}
$this->xmlMappings = array_merge($this->xmlMappings, $paths);
+
+ return $this;
}
/**
@@ -125,6 +133,8 @@ public function addYamlMapping($path)
}
$this->yamlMappings[] = $path;
+
+ return $this;
}
/**
@@ -137,6 +147,8 @@ public function addYamlMappings(array $paths)
}
$this->yamlMappings = array_merge($this->yamlMappings, $paths);
+
+ return $this;
}
/**
@@ -149,6 +161,8 @@ public function addMethodMapping($methodName)
}
$this->methodMappings[] = $methodName;
+
+ return $this;
}
/**
@@ -161,6 +175,8 @@ public function addMethodMappings(array $methodNames)
}
$this->methodMappings = array_merge($this->methodMappings, $methodNames);
+
+ return $this;
}
/**
@@ -181,6 +197,8 @@ public function enableAnnotationMapping(Reader $annotationReader = null)
}
$this->annotationReader = $annotationReader;
+
+ return $this;
}
/**
@@ -189,6 +207,8 @@ public function enableAnnotationMapping(Reader $annotationReader = null)
public function disableAnnotationMapping()
{
$this->annotationReader = null;
+
+ return $this;
}
/**
@@ -201,6 +221,8 @@ public function setMetadataFactory(ClassMetadataFactoryInterface $metadataFactor
}
$this->metadataFactory = $metadataFactory;
+
+ return $this;
}
/**
@@ -213,6 +235,8 @@ public function setMetadataCache(CacheInterface $cache)
}
$this->metadataCache = $cache;
+
+ return $this;
}
/**
@@ -221,6 +245,8 @@ public function setMetadataCache(CacheInterface $cache)
public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory)
{
$this->validatorFactory = $validatorFactory;
+
+ return $this;
}
/**

0 comments on commit f3bfba9

Please sign in to comment.
Something went wrong with that request. Please try again.