src/Zicht/Bundle/MenuBundle/Form/Subscriber/MenuItemPersistenceSubscriber.php
public function postSetData(FormEvent $e)
    {
        if ($e->getData() === null) {
            return;
        }

        // Checks if the form has a given property
        // A property can be removed in a child class but the eventSubscriber still exists
        if (!$e->getForm()->has($this->property)) {
            return;
        }
        if ($this->provider->supports($e->getData())) {
            if ($item = $this->mm->getItemBy(array(':path' => $this->provider->url($e->getData())))) {
                $item->setAddToMenu(true);
                $e->getForm()->get($this->property)->setData($item);
            }
        }
    }
public function postSetData(FormEvent $e)
    {
        if ($e->getData() === null) {
            return;
        }

        // Checks if the form has a given property
        // A property can be removed in a child class but the eventSubscriber still exists
        if (!$e->getForm()->has($this->property)) {
            return;
        }
        if ($this->provider->supports($e->getData())) {
            if ($item = $this->mm->getItemBy(array(':path' => $this->provider->url($e->getData())))) {
                $item->setAddToMenu(true);
                $e->getForm()->get($this->property)->setData($item);
            }
        }
    }
public function postSetData ( FormEvent $ e ) { if ( $ e -> getData ( ) === null ) { return ; } // Checks if the form has a given property // A property can be removed in a child class but the eventSubscriber still exists if ( ! $ e -> getForm ( ) -> has ( $ this -> property ) ) { return ; } if ( $ this -> provider -> supports ( $ e -> getData ( ) ) ) { if ( $ item = $ this -> mm -> getItemBy ( array ( ':path' => $ this -> provider -> url ( $ e -> getData ( ) ) ) ) ) { $ item -> setAddToMenu ( true ) ; $ e -> getForm ( ) -> get ( $ this -> property ) -> setData ( $ item ) ; } } }
POST_SET_DATA event handler

@param FormEvent $e
@return void
POST_SET_DATA event handler