PhpOffice\PhpPresentation\DocumentLayout::setCY PHP Method

setCY() public method

Get Document Layout cy
public setCY ( float $value, string $unit = self::UNIT_EMU ) : DocumentLayout
$value float
$unit string
return DocumentLayout
    public function setCY($value, $unit = self::UNIT_EMU)
    {
        $this->layout = self::LAYOUT_CUSTOM;
        $this->dimensionY = $this->convertUnit($value, $unit, self::UNIT_EMU);
        return $this;
    }

Usage Example

 public function testCY()
 {
     $value = rand(1, 100000);
     $object = new DocumentLayout();
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value));
     $this->assertEquals($value, $object->getCY());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_CENTIMETER));
     $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_CENTIMETER));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_EMU));
     $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_EMU));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_INCH));
     $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_INCH));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_MILLIMETER));
     $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_MILLIMETER));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_POINT));
     $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_POINT));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_PIXEL));
     $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_PIXEL));
 }