ScreenVideo.class.php 882 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Define a screenvideo.
  4. * @author Administrateur
  5. * @category Plugin
  6. * @license MIT
  7. */
  8. class ScreenVideo extends Entity{
  9. public $id;
  10. public $label; //Libellé (Texte)
  11. public $expire; //Expiration (Date)
  12. public $slug; //Slug (Texte)
  13. public $comment; //Commentaire (Texte Long)
  14. protected $TABLE_NAME = 'screenshare_screen_video';
  15. public $fields =
  16. array(
  17. 'id' => 'key',
  18. 'label' => 'string',
  19. 'expire' => 'date',
  20. 'slug' => 'string',
  21. 'comment' => 'longstring'
  22. );
  23. //Colonnes indexées
  24. public $indexes = array();
  25. public static function dir(){
  26. return File::dir().SLASH.'screenshare';
  27. }
  28. public function file(){
  29. if(!file_exists(self::dir())) mkdir(self::dir(),0755);
  30. return self::dir().SLASH.$this->id.'.webm';
  31. }
  32. public function remove(){
  33. self::deleteById($this->id);
  34. if(file_exists($this->file())) unlink($this->file());
  35. }
  36. }
  37. ?>