Part.class.php 522 B

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