4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\PropertyAccess
;
15 * A configurable builder for PropertyAccessorInterface objects.
17 * @author Jérémie Augustin <jeremie.augustin@pixel-cookers.com>
19 class PropertyAccessorBuilder
24 private $magicCall = false;
27 * Enables the use of "__call" by the ProperyAccessor.
29 * @return PropertyAccessorBuilder The builder object
31 public function enableMagicCall()
33 $this->magicCall
= true;
39 * Disables the use of "__call" by the ProperyAccessor.
41 * @return PropertyAccessorBuilder The builder object
43 public function disableMagicCall()
45 $this->magicCall
= false;
51 * @return Boolean true if the use of "__call" by the ProperyAccessor is enabled
53 public function isMagicCallEnabled()
55 return $this->magicCall
;
59 * Builds and returns a new propertyAccessor object.
61 * @return PropertyAccessorInterface The built propertyAccessor
63 public function getPropertyAccessor()
65 return new PropertyAccessor($this->magicCall
);