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

setCollection() public method

public setCollection ( $name )
    public function setCollection($name)
    {
        if (strlen($name) === 0) {
            throw new \RuntimeException('Invalid collection name. Expected a non-empty string.');
        }
        $this->collection = $name;
    }

Usage Example

Example #1
0
 /**
  * @expectedException \RuntimeException
  */
 public function testNullCollection()
 {
     $item = new Item('Raw content', 'index.html', []);
     $item->setCollection(null);
 }
All Usage Examples Of Yosymfony\Spress\Core\DataSource\Item::setCollection