Exemplo n.º 1
0
 /**
  * Commit current changes
  * returns array of new segments
  *
  * @return array
  */
 public function commit()
 {
     if ($this->_currentSegment !== null) {
         $newSegment = $this->_currentSegment->close();
         if ($newSegment !== null) {
             $this->_newSegments[$newSegment->getName()] = $newSegment;
         }
         $this->_currentSegment = null;
     }
     if (count($this->_newSegments) != 0) {
         $this->_updateSegments();
     }
     $result = $this->_newSegments;
     $this->_newSegments = array();
     return $result;
 }