class Callback in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/symfony/validator/Constraints/Callback.php \Symfony\Component\Validator\Constraints\Callback
- 8.0 vendor/zendframework/zend-feed/src/PubSubHubbub/Subscriber/Callback.php \Zend\Feed\PubSubHubbub\Subscriber\Callback
- 8.0 core/modules/migrate/src/Plugin/migrate/process/Callback.php \Drupal\migrate\Plugin\migrate\process\Callback
Same name and namespace in other branches
- 8 vendor/symfony/validator/Constraints/Callback.php \Symfony\Component\Validator\Constraints\Callback
@Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"})
@author Bernhard Schussek <bschussek@gmail.com>
Hierarchy
- class \Symfony\Component\Validator\Constraint
- class \Symfony\Component\Validator\Constraints\Callback
Expanded class hierarchy of Callback
Related topics
8 files declare their use of Callback
- Abstract2Dot5ApiTest.php in vendor/
symfony/ validator/ Tests/ Validator/ Abstract2Dot5ApiTest.php - AbstractLegacyApiTest.php in vendor/
symfony/ validator/ Tests/ Validator/ AbstractLegacyApiTest.php - AbstractValidatorTest.php in vendor/
symfony/ validator/ Tests/ Validator/ AbstractValidatorTest.php - AnnotationLoader.php in vendor/
symfony/ validator/ Mapping/ Loader/ AnnotationLoader.php - AnnotationLoaderTest.php in vendor/
symfony/ validator/ Tests/ Mapping/ Loader/ AnnotationLoaderTest.php
3 string references to 'Callback'
- ConstraintManager::registerDefinitions in core/
lib/ Drupal/ Core/ Validation/ ConstraintManager.php - Callback for registering definitions for constraints shipped with Symfony.
- RecursiveContextualValidatorTest::setupTypedData in core/
tests/ Drupal/ Tests/ Core/ TypedData/ RecursiveContextualValidatorTest.php - Setups a typed data object used for test purposes.
- RecursiveContextualValidatorTest::testBasicValidateWithConstraint in core/
tests/ Drupal/ Tests/ Core/ TypedData/ RecursiveContextualValidatorTest.php - @covers ::validate
File
- vendor/
symfony/ validator/ Constraints/ Callback.php, line 22
Namespace
Symfony\Component\Validator\ConstraintsView source
class Callback extends Constraint {
/**
* @var string|callable
*
* @since 2.4
*/
public $callback;
/**
* @var array
*
* @deprecated since version 2.4, to be removed in 3.0.
*/
public $methods;
/**
* {@inheritdoc}
*/
public function __construct($options = null) {
// Invocation through annotations with an array parameter only
if (is_array($options) && 1 === count($options) && isset($options['value'])) {
$options = $options['value'];
}
if (is_array($options) && isset($options['methods'])) {
@trigger_error('The "methods" option of the ' . __CLASS__ . ' class is deprecated since version 2.4 and will be removed in 3.0. Use the "callback" option instead.', E_USER_DEPRECATED);
}
if (is_array($options) && !isset($options['callback']) && !isset($options['methods']) && !isset($options['groups'])) {
if (is_callable($options) || !$options) {
$options = array(
'callback' => $options,
);
}
else {
// @deprecated, to be removed in 3.0
$options = array(
'methods' => $options,
);
}
}
parent::__construct($options);
}
/**
* {@inheritdoc}
*/
public function getDefaultOption() {
return 'callback';
}
/**
* {@inheritdoc}
*/
public function getTargets() {
return array(
self::CLASS_CONSTRAINT,
self::PROPERTY_CONSTRAINT,
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Callback:: |
public | property | @since 2.4 | |
Callback:: |
public | property | ||
Callback:: |
public | function |
Returns the name of the default option. Overrides Constraint:: |
|
Callback:: |
public | function |
Returns whether the constraint can be put onto classes, properties or
both. Overrides Constraint:: |
|
Callback:: |
public | function |
Initializes the constraint with options. Overrides Constraint:: |
|
Constraint:: |
protected static | property | Maps error codes to the names of their constants. | 16 |
Constraint:: |
public | property | Domain-specific data attached to a constraint. | |
Constraint:: |
public | function | Adds the given group if this constraint is in the Default group. | 1 |
Constraint:: |
constant | Marks a constraint that can be put onto classes. | ||
Constraint:: |
constant | The name of the group given to all constraints with no explicit group. | ||
Constraint:: |
public static | function | Returns the name of the given error code. | |
Constraint:: |
public | function | Returns the name of the required options. | 11 |
Constraint:: |
constant | Marks a constraint that can be put onto properties. | ||
Constraint:: |
public | function | Returns the name of the class that validates this constraint. | 11 |
Constraint:: |
public | function | Returns the value of a lazily initialized option. | 1 |
Constraint:: |
public | function | Sets the value of a lazily initialized option. | 1 |
Constraint:: |
public | function | Optimizes the serialized value to minimize storage space. |