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

setAttributes() public method

public setAttributes ( array $values )
$values array
    public function setAttributes(array $values)
    {
        $this->attributes = $values;
    }

Usage Example

Example #1
0
 public function testAttributes()
 {
     $item = new Item('Test of content', 'index.html', ['name' => 'test']);
     $this->assertCount(1, $item->getAttributes());
     $item->setAttributes(['attr1' => 'text 1', 'attr2' => 'text 2']);
     $this->assertCount(2, $item->getAttributes());
 }
All Usage Examples Of Yosymfony\Spress\Core\DataSource\Item::setAttributes