vendor/sulu/sulu/src/Sulu/Bundle/DocumentManagerBundle/Session/Session.php line 84

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Sulu.
  4.  *
  5.  * (c) Sulu GmbH
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Sulu\Bundle\DocumentManagerBundle\Session;
  11. use PHPCR\CredentialsInterface;
  12. use PHPCR\SessionInterface;
  13. /**
  14.  * Used to wrap the PHPCR session and add some Sulu specific logic on top of it.
  15.  */
  16. class Session implements SessionInterface
  17. {
  18.     /**
  19.      * @var SessionInterface
  20.      */
  21.     private $inner;
  22.     public function __construct(SessionInterface $inner)
  23.     {
  24.         $this->inner $inner;
  25.     }
  26.     public function getRepository()
  27.     {
  28.         return $this->inner->getRepository();
  29.     }
  30.     public function getUserID()
  31.     {
  32.         return $this->inner->getUserID();
  33.     }
  34.     public function getAttributeNames()
  35.     {
  36.         return $this->inner->getAttributeNames();
  37.     }
  38.     public function getAttribute($name)
  39.     {
  40.         return $this->inner->getAttribute($name);
  41.     }
  42.     public function getWorkspace()
  43.     {
  44.         return $this->inner->getWorkspace();
  45.     }
  46.     public function getRootNode()
  47.     {
  48.         return $this->inner->getRootNode();
  49.     }
  50.     public function impersonate(CredentialsInterface $credentials)
  51.     {
  52.         return $this->inner->impersonate($credentials);
  53.     }
  54.     public function getNodeByIdentifier($id)
  55.     {
  56.         return $this->inner->getNodeByIdentifier($id);
  57.     }
  58.     public function getNodesByIdentifier($ids)
  59.     {
  60.         return $this->inner->getNodesByIdentifier($ids);
  61.     }
  62.     public function getItem($absPath)
  63.     {
  64.         return $this->inner->getItem($absPath);
  65.     }
  66.     public function getNode($absPath$depthHint = -1)
  67.     {
  68.         return $this->inner->getNode($absPath$depthHint);
  69.     }
  70.     public function getNodes($absPaths)
  71.     {
  72.         return $this->inner->getNodes($absPaths);
  73.     }
  74.     public function getProperty($absPath)
  75.     {
  76.         return $this->inner->getProperty($absPath);
  77.     }
  78.     public function getProperties($absPaths)
  79.     {
  80.         return $this->inner->getProperties($absPaths);
  81.     }
  82.     public function itemExists($absPath)
  83.     {
  84.         return $this->inner->itemExists($absPath);
  85.     }
  86.     public function nodeExists($absPath)
  87.     {
  88.         return $this->inner->nodeExists($absPath);
  89.     }
  90.     public function propertyExists($absPath)
  91.     {
  92.         return $this->inner->propertyExists($absPath);
  93.     }
  94.     public function move($srcAbsPath$destAbsPath)
  95.     {
  96.         return $this->inner->move($srcAbsPath$destAbsPath);
  97.     }
  98.     public function removeItem($absPath)
  99.     {
  100.         return $this->inner->removeItem($absPath);
  101.     }
  102.     public function save()
  103.     {
  104.         return $this->inner->save();
  105.     }
  106.     public function refresh($keepChanges)
  107.     {
  108.         return $this->inner->refresh($keepChanges);
  109.     }
  110.     public function hasPendingChanges()
  111.     {
  112.         return $this->inner->hasPendingChanges();
  113.     }
  114.     public function hasPermission($absPath$actions)
  115.     {
  116.         return $this->inner->hasPermission($absPath$actions);
  117.     }
  118.     public function checkPermission($absPath$actions)
  119.     {
  120.         return $this->inner->checkPermission($absPath$actions);
  121.     }
  122.     public function hasCapability($methodName$target, array $arguments)
  123.     {
  124.         return $this->inner->hasCapability($methodName$target$arguments);
  125.     }
  126.     public function importXML($parentAbsPath$uri$uuidBehavior)
  127.     {
  128.         return $this->inner->importXML($parentAbsPath$uri$uuidBehavior);
  129.     }
  130.     public function exportSystemView($absPath$stream$skipBinary$noRecurse)
  131.     {
  132.         $memoryStream fopen('php://memory''w+');
  133.         $this->inner->exportSystemView($absPath$memoryStream$skipBinary$noRecurse);
  134.         rewind($memoryStream);
  135.         $content stream_get_contents($memoryStream);
  136.         $document = new \DOMDocument();
  137.         $document->loadXML($content);
  138.         $xpath = new \DOMXPath($document);
  139.         $xpath->registerNamespace('sv''http://www.jcp.org/jcr/sv/1.0');
  140.         foreach ($xpath->query('//sv:property[@sv:name="sulu:versions" or @sv:name="jcr:versionHistory" or @sv:name="jcr:baseVersion" or @sv:name="jcr:predecessors" or @sv:name="jcr:isCheckedOut"]') as $element) {
  141.             $element->parentNode->removeChild($element);
  142.         }
  143.         fwrite($stream$document->saveXML());
  144.     }
  145.     public function exportDocumentView($absPath$stream$skipBinary$noRecurse)
  146.     {
  147.         return $this->inner->exportDocumentView($absPath$stream$skipBinary$noRecurse);
  148.     }
  149.     public function setNamespacePrefix($prefix$uri)
  150.     {
  151.         return $this->inner->setNamespacePrefix($prefix$uri);
  152.     }
  153.     public function getNamespacePrefixes()
  154.     {
  155.         return $this->inner->getNamespacePrefixes();
  156.     }
  157.     public function getNamespaceURI($prefix)
  158.     {
  159.         return $this->inner->getNamespaceURI($prefix);
  160.     }
  161.     public function getNamespacePrefix($uri)
  162.     {
  163.         return $this->inner->getNamespacePrefix($uri);
  164.     }
  165.     public function logout()
  166.     {
  167.         return $this->inner->logout();
  168.     }
  169.     public function isLive()
  170.     {
  171.         return $this->inner->isLive();
  172.     }
  173.     public function getAccessControlManager()
  174.     {
  175.         return $this->inner->getAccessControlManager();
  176.     }
  177.     public function getRetentionManager()
  178.     {
  179.         return $this->inner->getRetentionManager();
  180.     }
  181. }