public function validate($value)
{
$this->result = new ErrorResult();
if ($this->acceptsEmptyValues === false || $this->isEmpty($value) === false) {
if ($value instanceof \Doctrine\ORM\PersistentCollection && !$value->isInitialized()) {
return $this->result;
} elseif (is_object($value) && !TypeHandling::isCollectionType(get_class($value)) && !is_array($value)) {
$this->addError('The given subject was not a collection.', 1317204797);
return $this->result;
} elseif (is_object($value) && $this->isValidatedAlready($value)) {
return $this->result;
} else {
$this->isValid($value);
}
}
return $this->result;
}