server/lib/migration/provider.php

53 lines
1 KiB
PHP
Raw Normal View History

<?php
/**
* provides search functionalty
*/
abstract class OC_Migration_Provider{
2012-08-29 06:38:33 +00:00
protected $id=false;
2012-08-29 06:38:33 +00:00
protected $content=false;
protected $uid=false;
2012-03-20 20:19:21 +00:00
protected $olduid=false;
protected $appinfo=false;
2012-08-29 06:38:33 +00:00
2012-09-07 13:22:01 +00:00
public function __construct( $appid ) {
// Set the id
$this->id = $appid;
OC_Migrate::registerProvider( $this );
}
2012-08-29 06:38:33 +00:00
/**
2012-04-14 16:31:37 +00:00
* @brief exports data for apps
* @return array appdata to be exported
*/
abstract function export( );
2012-08-29 06:38:33 +00:00
/**
2012-04-14 16:31:37 +00:00
* @brief imports data for the app
* @return void
*/
abstract function import( );
2012-08-29 06:38:33 +00:00
/**
2012-04-14 16:31:37 +00:00
* @brief sets the OC_Migration_Content object to $this->content
* @param $content a OC_Migration_Content object
*/
2012-09-07 13:22:01 +00:00
public function setData( $uid, $content, $info=null ) {
2012-08-29 06:38:33 +00:00
$this->content = $content;
$this->uid = $uid;
$id = $this->id;
2012-09-07 13:22:01 +00:00
if( !is_null( $info ) ) {
2012-03-27 20:43:44 +00:00
$this->olduid = $info->exporteduser;
$this->appinfo = $info->apps->$id;
}
}
2012-08-29 06:38:33 +00:00
/**
2012-04-14 16:31:37 +00:00
* @brief returns the appid of the provider
* @return string
*/
2012-09-07 13:22:01 +00:00
public function getID() {
2012-08-29 06:38:33 +00:00
return $this->id;
}
}