Resource.class.php 531 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Define a resource
  4. * @author valentin carruesco
  5. * @category Core
  6. * @license copyright
  7. */
  8. class Resource extends Entity{
  9. public $id,$label,$type,$content,$sketch,$sort;
  10. protected $fields =
  11. array(
  12. 'id'=>'key',
  13. 'label' => 'string',
  14. 'sort' => 'int',
  15. 'type' => 'string',
  16. 'content' => 'longstring',
  17. 'sketch' => 'int'
  18. );
  19. public function remove(){
  20. Resource::deleteById($this->id);
  21. if($this->type == 'image' && file_exists(SKETCH_PATH.$this->content))
  22. unlink(SKETCH_PATH.$this->content);
  23. }
  24. }
  25. ?>