Skip to content

Commit

Permalink
Merge pull request #27 from oat-sa/feature/TAO-2329_stream_loading
Browse files Browse the repository at this point in the history
Feature/tao 2329 stream loading
  • Loading branch information
Jérôme Bogaerts committed Mar 31, 2016
2 parents 14b622f + c3e5e92 commit 93ee673
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 180 deletions.
56 changes: 36 additions & 20 deletions qtism/data/QtiDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,69 +26,85 @@
use qtism\data\storage\StorageException;

abstract class QtiDocument {

/**
*
*
* @var string
*/
private $version = '2.1';

/**
*
*
* @var QtiComponent
*/
private $documentComponent;

/**
*
*
* @var string
*/
private $url;

public function __construct($version = '2.1', QtiComponent $documentComponent = null) {
$this->setVersion($version);
$this->setDocumentComponent($documentComponent);
}

public function setVersion($version) {
$this->version = $version;
}

public function getVersion() {
return $this->version;
}

public function setDocumentComponent(QtiComponent $documentComponent = null) {
$this->documentComponent = $documentComponent;
}

/**
*
*
* @return QtiComponent
*/
public function getDocumentComponent() {
return $this->documentComponent;
}

protected function setUrl($url) {
$this->url = $url;
}

public function getUrl() {
return $this->url;
}

/**
*
*
* @param string $url
* @throws StorageException
* @throws StorageException
*/
abstract public function load($url);

/**
*
*
* @param string $url
* @throws StorageException
*/
abstract public function save($url);
}

/**
* Load the document content from a string.
*
* @param string $data
* @return string
* @throws StorageException
*/
abstract public function loadFromString($data);

/**
* Save the document content as a string.
*
* @return string
*/
abstract public function saveToString();
}
Loading

0 comments on commit 93ee673

Please sign in to comment.