Submit
Path:
~
/
/
opt
/
cloudlinux
/
alt-php53
/
root
/
usr
/
share
/
pear
/
Symfony
/
Component
/
Form
/
File Content:
Button.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form; use Symfony\Component\Form\Exception\AlreadySubmittedException; use Symfony\Component\Form\Exception\BadMethodCallException; /** * A form button. * * @author Bernhard Schussek <bschussek@gmail.com> */ class Button implements \IteratorAggregate, FormInterface { /** * @var FormInterface|null */ private $parent; /** * @var FormConfigInterface */ private $config; /** * @var Boolean */ private $submitted = false; /** * Creates a new button from a form configuration. * * @param FormConfigInterface $config The button's configuration. */ public function __construct(FormConfigInterface $config) { $this->config = $config; } /** * Unsupported method. * * @param mixed $offset * * @return Boolean Always returns false. */ public function offsetExists($offset) { return false; } /** * Unsupported method. * * This method should not be invoked. * * @param mixed $offset * * @throws BadMethodCallException */ public function offsetGet($offset) { throw new BadMethodCallException('Buttons cannot have children.'); } /** * Unsupported method. * * This method should not be invoked. * * @param mixed $offset * @param mixed $value * * @throws BadMethodCallException */ public function offsetSet($offset, $value) { throw new BadMethodCallException('Buttons cannot have children.'); } /** * Unsupported method. * * This method should not be invoked. * * @param mixed $offset * * @throws BadMethodCallException */ public function offsetUnset($offset) { throw new BadMethodCallException('Buttons cannot have children.'); } /** * {@inheritdoc} */ public function setParent(FormInterface $parent = null) { $this->parent = $parent; } /** * {@inheritdoc} */ public function getParent() { return $this->parent; } /** * Unsupported method. * * This method should not be invoked. * * @param int|string|FormInterface $child * @param null $type * @param array $options * * @throws BadMethodCallException */ public function add($child, $type = null, array $options = array()) { throw new BadMethodCallException('Buttons cannot have children.'); } /** * Unsupported method. * * This method should not be invoked. * * @param string $name * * @throws BadMethodCallException */ public function get($name) { throw new BadMethodCallException('Buttons cannot have children.'); } /** * Unsupported method. * * @param string $name * * @return Boolean Always returns false. */ public function has($name) { return false; } /** * Unsupported method. * * This method should not be invoked. * * @param string $name * * @throws BadMethodCallException */ public function remove($name) { throw new BadMethodCallException('Buttons cannot have children.'); } /** * {@inheritdoc} */ public function all() { return array(); } /** * {@inheritdoc} */ public function getErrors() { return array(); } /** * Unsupported method. * * This method should not be invoked. * * @param string $modelData * * @throws BadMethodCallException */ public function setData($modelData) { // called during initialization of the form tree // noop } /** * Unsupported method. * * @return null Always returns null. */ public function getData() { return null; } /** * Unsupported method. * * @return null Always returns null. */ public function getNormData() { return null; } /** * Unsupported method. * * @return null Always returns null. */ public function getViewData() { return null; } /** * Unsupported method. * * @return array Always returns an empty array. */ public function getExtraData() { return array(); } /** * Returns the button's configuration. * * @return FormConfigInterface The configuration. */ public function getConfig() { return $this->config; } /** * Returns whether the button is submitted. * * @return Boolean true if the button was submitted. */ public function isSubmitted() { return $this->submitted; } /** * Returns the name by which the button is identified in forms. * * @return string The name of the button. */ public function getName() { return $this->config->getName(); } /** * Unsupported method. * * @return null Always returns null. */ public function getPropertyPath() { return null; } /** * Unsupported method. * * @param FormError $error * * @throws BadMethodCallException */ public function addError(FormError $error) { throw new BadMethodCallException('Buttons cannot have errors.'); } /** * Unsupported method. * * @return Boolean Always returns true. */ public function isValid() { return true; } /** * Unsupported method. * * @return Boolean Always returns false. */ public function isRequired() { return false; } /** * {@inheritdoc} */ public function isDisabled() { return $this->config->getDisabled(); } /** * Unsupported method. * * @return Boolean Always returns true. */ public function isEmpty() { return true; } /** * Unsupported method. * * @return Boolean Always returns true. */ public function isSynchronized() { return true; } /** * Unsupported method. * * @throws BadMethodCallException */ public function initialize() { throw new BadMethodCallException('Buttons cannot be initialized. Call initialize() on the root form instead.'); } /** * Unsupported method. * * @param mixed $request * * @throws BadMethodCallException */ public function handleRequest($request = null) { throw new BadMethodCallException('Buttons cannot handle requests. Call handleRequest() on the root form instead.'); } /** * Submits data to the button. * * @param null|string $submittedData The data. * @param Boolean $clearMissing Not used. * * @return Button The button instance * * @throws Exception\AlreadySubmittedException If the button has already been submitted. */ public function submit($submittedData, $clearMissing = true) { if ($this->submitted) { throw new AlreadySubmittedException('A form can only be submitted once'); } $this->submitted = true; return $this; } /** * {@inheritdoc} */ public function getRoot() { return $this->parent ? $this->parent->getRoot() : $this; } /** * {@inheritdoc} */ public function isRoot() { return null === $this->parent; } /** * {@inheritdoc} */ public function createView(FormView $parent = null) { if (null === $parent && $this->parent) { $parent = $this->parent->createView(); } $type = $this->config->getType(); $options = $this->config->getOptions(); $view = $type->createView($this, $parent); $type->buildView($view, $this, $options); $type->finishView($view, $this, $options); return $view; } /** * Unsupported method. * * @return integer Always returns 0. */ public function count() { return 0; } /** * Unsupported method. * * @return \EmptyIterator Always returns an empty iterator. */ public function getIterator() { return new \EmptyIterator(); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
Exception
---
0755
Extension
---
0755
Guess
---
0755
Resources
---
0755
Test
---
0755
Util
---
0755
AbstractExtension.php
4885 bytes
0644
AbstractRendererEngine.php
7634 bytes
0644
AbstractType.php
1080 bytes
0644
AbstractTypeExtension.php
993 bytes
0644
Button.php
8826 bytes
0644
ButtonBuilder.php
18523 bytes
0644
ButtonTypeInterface.php
462 bytes
0644
CallbackTransformer.php
2138 bytes
0644
ClickableInterface.php
559 bytes
0644
DataMapperInterface.php
1130 bytes
0644
DataTransformerInterface.php
3159 bytes
0644
Form.php
34865 bytes
0644
FormBuilder.php
7871 bytes
0644
FormBuilderInterface.php
2335 bytes
0644
FormConfigBuilder.php
21680 bytes
0644
FormConfigBuilderInterface.php
8666 bytes
0644
FormConfigInterface.php
6437 bytes
0644
FormError.php
2563 bytes
0644
FormEvent.php
1247 bytes
0644
FormEvents.php
1140 bytes
0644
FormExtensionInterface.php
1668 bytes
0644
FormFactory.php
5225 bytes
0644
FormFactoryBuilder.php
3609 bytes
0644
FormFactoryBuilderInterface.php
3058 bytes
0644
FormFactoryInterface.php
4244 bytes
0644
FormInterface.php
8328 bytes
0644
FormRegistry.php
4753 bytes
0644
FormRegistryInterface.php
1442 bytes
0644
FormRenderer.php
11954 bytes
0644
FormRendererEngineInterface.php
7063 bytes
0644
FormRendererInterface.php
3279 bytes
0644
FormTypeExtensionInterface.php
2125 bytes
0644
FormTypeGuesserChain.php
2880 bytes
0644
FormTypeGuesserInterface.php
2170 bytes
0644
FormTypeInterface.php
3222 bytes
0644
FormView.php
3524 bytes
0644
Forms.php
5899 bytes
0644
NativeRequestHandler.php
5612 bytes
0644
PreloadedExtension.php
2317 bytes
0644
RequestHandlerInterface.php
668 bytes
0644
ResolvedFormType.php
7662 bytes
0644
ResolvedFormTypeFactory.php
658 bytes
0644
ResolvedFormTypeFactoryInterface.php
1302 bytes
0644
ResolvedFormTypeInterface.php
3307 bytes
0644
ReversedTransformer.php
1256 bytes
0644
SubmitButton.php
1137 bytes
0644
SubmitButtonBuilder.php
624 bytes
0644
SubmitButtonTypeInterface.php
474 bytes
0644
autoloader.php
334 bytes
0644
N4ST4R_ID | Naxtarrr