Part.class.php 631 B

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