| 1234567891011121314151617181920212223242526272829303132 | 
							- <?php
 
- /**
 
- * Define a resource
 
- * @author valentin carruesco
 
- * @category Core
 
- * @license copyright
 
- */
 
- class Resource extends Entity{
 
- 	public $id,$label,$type,$content,$sketch,$sort;
 
- 	protected $fields = 
 
- 	array(
 
- 		'id'=>'key',
 
- 		'label' => 'string',
 
- 		'sort' => 'int',
 
- 		'type' => 'string',
 
- 		'content' => 'longstring',
 
- 		'sketch' => 'int'
 
- 	);
 
- 	
 
- 	public function remove(){
 
- 		Resource::deleteById($this->id);
 
- 		if($this->type == 'image' && file_exists(SKETCH_PATH.$this->content))
 
- 			unlink(SKETCH_PATH.$this->content);
 
- 	}
 
- 	
 
- }
 
- ?>
 
 
  |