provider.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * provides search functionalty
  4. */
  5. abstract class OC_Migration_Provider{
  6. protected $id=false;
  7. protected $content=false;
  8. protected $uid=false;
  9. protected $olduid=false;
  10. protected $appinfo=false;
  11. public function __construct( $appid ){
  12. // Set the id
  13. $this->id = $appid;
  14. OC_Migrate::registerProvider( $this );
  15. }
  16. /**
  17. * @brief exports data for apps
  18. * @return array appdata to be exported
  19. */
  20. abstract function export( );
  21. /**
  22. * @brief imports data for the app
  23. * @return void
  24. */
  25. abstract function import( );
  26. /**
  27. * @brief sets the OC_Migration_Content object to $this->content
  28. * @param $content a OC_Migration_Content object
  29. */
  30. public function setData( $uid, $content, $info=null ){
  31. $this->content = $content;
  32. $this->uid = $uid;
  33. $id = $this->id;
  34. if( !is_null( $info ) ){
  35. $this->olduid = $info->exporteduser;
  36. $this->appinfo = $info->apps->$id;
  37. }
  38. }
  39. /**
  40. * @brief returns the appid of the provider
  41. * @return string
  42. */
  43. public function getID(){
  44. return $this->id;
  45. }
  46. }