* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Workflow\MarkingStore; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\Workflow\Marking; /** * MultipleStateMarkingStore stores the marking into a property of the * subject. * * This store deals with a "multiple state" Marking. It means a subject can be * in many states at the same time. * * @author Grégoire Pineau */ class MultipleStateMarkingStore implements MarkingStoreInterface { private $property; private $propertyAccessor; /** * @param string $property * @param PropertyAccessorInterface|null $propertyAccessor */ public function __construct($property = 'marking', PropertyAccessorInterface $propertyAccessor = null) { $this->property = $property; $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor(); } /** * {@inheritdoc} */ public function getMarking($subject) { return new Marking($this->propertyAccessor->getValue($subject, $this->property) ?: array()); } /** * {@inheritdoc} */ public function setMarking($subject, Marking $marking) { $this->propertyAccessor->setValue($subject, $this->property, $marking->getPlaces()); } /** * @return string */ public function getProperty() { return $this->property; } } __halt_compiler();----SIGNATURE:----kOs5vDJ6CVIV8jZXf2RMGeTVr/dZiTUWoEMPD9s1bM7eRnyN3ijUptF99GPqV/d4MWvAc1V4jRfdjB76/46Mh+wKAVi9EfAhQntmAL7j+y4UUJPQWSl1KjJTTJ+RmEHSIvXrucyAbAtgYK/o/rlJCJjXSIBoJpCNLNpkQlVia+YkI2YwOaPtMX7g84bEW2e0BHBSPpGYZHTwBJfO6oGIibG4f9OqIyeCgnsUH5fjYdHDK2Y0GZkM988TDV9uZ73ubWnieqdCU2goQk87pq2ME7CGV5SVSzaxWPkMBcAqipfXfhCf+DIlGSGvYev2dVYXUUbLCCp/x6MAfFcctkFxLlWcqasBOuNd4GJv6DI6vvVHQsVOCK3xVGt2IIPUmCj95ZNiF3R6X2/VXz2U+qqP4Zc/ngBxqSkK2LyU+DyPsqMlRTQKkkOkUuQnZWuE725Gp0bCWBeIL/wooBt8jXEBgzD4FISBczOq2g5jMn4TNw4WpDll3ZEpi2MPUCwmS0d4gu7il3NNHZE4/hYwVKIrlzpZT0XUcVafKZJJSV0e1NogSMwoqqBgwr1gPp5BPIwK2FfDoTyRfKgwiaRq7PmOjLp27y09aeHNhWrEqYzC1sxkbt7Fu6Apjjlmep0rpM9o/zTw8dGsLrcxQCiffmVFn8Q8LymaL7yX3KoK/t3oU5U=----ATTACHMENT:----OTcyOTk2NTQ4NTAzOTUwNSAyNjI3NjUzMzYzNjY1MjY3IDE1NDkxMDkyNzMyMDI3NzI=