PhpOffice\PhpPresentation\Style\Alignment::setLevel PHP Method

setLevel() public method

Set Level
public setLevel ( integer $pValue ) : Alignment
$pValue integer Ranging 0 - 8
return Alignment
    public function setLevel($pValue = 0)
    {
        if ($pValue < 0) {
            throw new \Exception("Invalid value should be more than 0.");
        }
        $this->level = $pValue;
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Test get/set level
  */
 public function testSetGetLevel()
 {
     $object = new Alignment();
     $value = rand(1, 8);
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setLevel($value));
     $this->assertEquals($value, $object->getLevel());
 }
All Usage Examples Of PhpOffice\PhpPresentation\Style\Alignment::setLevel