Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector::getWebspace PHP Method

getWebspace() public method

Return the webspace name for the given document.
public getWebspace ( object $document ) : string
$document object
return string
    public function getWebspace($document)
    {
        return $this->extractWebspaceFromPath($this->getPath($document));
    }

Usage Example

コード例 #1
0
 public function testHandleWebspace()
 {
     $document = $this->prophesize(WebspaceBehavior::class);
     $this->persistEvent->getDocument()->willReturn($document);
     $this->inspector->getWebspace($document->reveal())->willReturn('example');
     $this->accessor->set('webspaceName', 'example')->shouldBeCalled();
     $this->subscriber->handleWebspace($this->persistEvent->reveal());
 }
All Usage Examples Of Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector::getWebspace