plugin/link/Serializer/ShortcutSerializer.php
public function deserialize(array $data, Shortcut $shortcut)
    {
        if (!empty($data['target']) &&
            !empty($data['target']['id']) &&
            (!$shortcut->getTarget() || $data['target']['id'] !== $shortcut->getTarget()->getUuid())
        ) {
            // the target is specified and as changed
            /** @var ResourceNode $target */
            $target = $this->om
                ->getRepository('ClarolineCoreBundle:Resource\ResourceNode')
                ->findOneBy(['uuid' => $data['target']['id']]);

            $shortcut->setTarget($target);
        }
    }
public function deserialize(array $data, Shortcut $shortcut)
    {
        if (!empty($data['target']) &&
            !empty($data['target']['id']) &&
            (!$shortcut->getTarget() || $data['target']['id'] !== $shortcut->getTarget()->getUuid())
        ) {
            // the target is specified and as changed
            /** @var ResourceNode $target */
            $target = $this->om
                ->getRepository('ClarolineCoreBundle:Resource\ResourceNode')
                ->findOneBy(['uuid' => $data['target']['id']]);

            $shortcut->setTarget($target);
        }
    }
public function deserialize ( array $ data , Shortcut $ shortcut ) { if ( ! empty ( $ data [ 'target' ] ) && ! empty ( $ data [ 'target' ] [ 'id' ] ) && ( ! $ shortcut -> getTarget ( ) || $ data [ 'target' ] [ 'id' ] !== $ shortcut -> getTarget ( ) -> getUuid ( ) ) ) { // the target is specified and as changed /** @var ResourceNode $target */ $ target = $ this -> om -> getRepository ( 'ClarolineCoreBundle:Resource\ResourceNode' ) -> findOneBy ( [ 'uuid' => $ data [ 'target' ] [ 'id' ] ] ) ; $ shortcut -> setTarget ( $ target ) ; } }
Deserializes shortcut data into an Entity.

@param array    $data
@param Shortcut $shortcut

@return Shortcut
Deserializes shortcut data into an Entity .