Captioning\Format\SubripFile::buildPart PHP Method

buildPart() public method

public buildPart ( $_from, $_to )
    public function buildPart($_from, $_to)
    {
        $this->sortCues();
        $i = 1;
        $buffer = "";
        if ($_from < 0 || $_from >= $this->getCuesCount()) {
            $_from = 0;
        }
        if ($_to < 0 || $_to >= $this->getCuesCount()) {
            $_to = $this->getCuesCount() - 1;
        }
        for ($j = $_from; $j <= $_to; $j++) {
            $cue = $this->getCue($j);
            $buffer .= $i . $this->lineEnding;
            $buffer .= $cue->getTimeCodeString() . $this->lineEnding;
            $buffer .= $cue->getText($this->options['_stripTags'], $this->options['_stripBasic'], $this->options['_replacements']);
            $buffer .= $this->lineEnding;
            $buffer .= $this->lineEnding;
            $i++;
        }
        $this->fileContent = $buffer;
        return $this;
    }