* * 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:----FOmC26vObKIYdMrSXnUJAgR75r6u1Y/bQdyVw5EZ1SKJj4bXWEvjzQPVWXNqPjbfX1Y/JN6ZbYKA/Ccpip4ilBqvc7z9HzOsUp0j2wH0l/22cHzzJgeQouF5+KVEugRAgg7Y6SM2qTfpx+bOj33aSjHXBcXczaBSayZkStJOiHVKK57DOjYBVLgIbdwIc0JjB3Oc0Nr7toZcjR5sb3dSUWvRTA1bj2QXjjNQ9lYjO2VtxUGLJ6Qii4DfvRexeZILV6el/ZFAiMX7MVsp6W3hTSpTSxPtBR8fBkIZ1LirkMKBt4N+3nd9Ega7ekJS4t1vaB+2idU48z6hqPnSdNkJiKZ3Y1fle5vGLkdjSzuAMx51ivsytX/iSwtWT3j301eiQItSGo/6e+X1CWPlW0M1zr6Ij7FnHgD0uviud5SdE36MC7XiMQ2KD44cWCdXFphxfgC6CxtMyd2elAs1BUzVArPHsCA/b1OJWIKjpbjuCk3XaRzQkoTPV17MxzSF+/k9SbUd1Yf9+2s1dZProB1fTZNlrclLT4aMWVqzz/u6Rq/WdUNGXRgTyfb+j3SDl99S8vH4ZT6GLOjf+17/zA2byKY/YdCINkaUApl8t6Wwe6PdUbhAkgu8dB8XSLK+tN23k7qDZo5nqscrrKZTo5BJxmSM91eYzNBW9Le70IdpLc8=----ATTACHMENT:----NjI5MjAyMTI1MDY4NTk5OSAyNDQ2MzIwNjE5Njg0NjY4IDM0MjYzNTkwODQxNDI4ODY=