You are here

class BlackHoleMetadataFactory in Plug 7

Same name in this branch
  1. 7 lib/Symfony/validator/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php \Symfony\Component\Validator\Mapping\BlackholeMetadataFactory
  2. 7 lib/Symfony/validator/Symfony/Component/Validator/Mapping/Factory/BlackHoleMetadataFactory.php \Symfony\Component\Validator\Mapping\Factory\BlackHoleMetadataFactory

Metadata factory that does not store metadata.

This implementation is useful if you want to validate values against constraints only and you don't need to add constraints to classes and properties.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

Expanded class hierarchy of BlackHoleMetadataFactory

1 file declares its use of BlackHoleMetadataFactory
BlackHoleMetadataFactoryTest.php in lib/Symfony/validator/Symfony/Component/Validator/Tests/Mapping/Factory/BlackHoleMetadataFactoryTest.php

File

lib/Symfony/validator/Symfony/Component/Validator/Mapping/Factory/BlackHoleMetadataFactory.php, line 23

Namespace

Symfony\Component\Validator\Mapping\Factory
View source
class BlackHoleMetadataFactory implements MetadataFactoryInterface {

  /**
   * {@inheritdoc}
   */
  public function getMetadataFor($value) {
    throw new \LogicException('This class does not support metadata.');
  }

  /**
   * {@inheritdoc}
   */
  public function hasMetadataFor($value) {
    return false;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BlackHoleMetadataFactory::getMetadataFor public function Returns the metadata for the given value. Overrides MetadataFactoryInterface::getMetadataFor
BlackHoleMetadataFactory::hasMetadataFor public function Returns whether the class is able to return metadata for the given value. Overrides MetadataFactoryInterface::hasMetadataFor