Yosymfony\Spress\Core\DataSource\Item::getPath PHP Method

getPath() public method

public getPath ( $snapshotName = '' )
    public function getPath($snapshotName = '')
    {
        if ($snapshotName) {
            if (isset($this->pathSnapshot[$snapshotName]) === false) {
                return '';
            }
            return $this->pathSnapshot[$snapshotName];
        }
        return isset($this->pathSnapshot[self::SNAPSHOT_PATH_LAST]) === true ? $this->pathSnapshot[self::SNAPSHOT_PATH_LAST] : '';
    }

Usage Example

Example #1
0
 public function testPathNotInitialized()
 {
     $item = new Item('Raw content', 'index.html', []);
     $this->assertEquals('', $item->getPath());
 }