src/Creative/InLine/Linear.php
public function setDuration($duration)
    {
        // get dom element
        $durationDomElement = $this->getDomElement()->getElementsByTagName('Duration')->item(0);
        if (!$durationDomElement) {
            $durationDomElement = $this->getDomElement()->ownerDocument->createElement('Duration');
            $this->getDomElement()->firstChild->appendChild($durationDomElement);
        }

        // set value
        if (is_numeric($duration)) {
            // in seconds
            $duration = $this->secondsToString($duration);
        }

        $durationDomElement->nodeValue = $duration;

        return $this;
    }
public function setDuration($duration)
    {
        // get dom element
        $durationDomElement = $this->getDomElement()->getElementsByTagName('Duration')->item(0);
        if (!$durationDomElement) {
            $durationDomElement = $this->getDomElement()->ownerDocument->createElement('Duration');
            $this->getDomElement()->firstChild->appendChild($durationDomElement);
        }

        // set value
        if (is_numeric($duration)) {
            // in seconds
            $duration = $this->secondsToString($duration);
        }

        $durationDomElement->nodeValue = $duration;

        return $this;
    }
public function setDuration ( $ duration ) { // get dom element $ durationDomElement = $ this -> getDomElement ( ) -> getElementsByTagName ( 'Duration' ) -> item ( 0 ) ; if ( ! $ durationDomElement ) { $ durationDomElement = $ this -> getDomElement ( ) -> ownerDocument -> createElement ( 'Duration' ) ; $ this -> getDomElement ( ) -> firstChild -> appendChild ( $ durationDomElement ) ; } // set value if ( is_numeric ( $ duration ) ) { // in seconds $ duration = $ this -> secondsToString ( $ duration ) ; } $ durationDomElement -> nodeValue = $ duration ; return $ this ; }
Set duration value

@param int|string $duration seconds or time in format "H:m:i"

@return $this
Set duration value