Sketch.class.php 552 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Define a Sketch.
  4. *
  5. * @author valentin carruesco
  6. *
  7. * @category Core
  8. *
  9. * @license copyright
  10. */
  11. class Sketch extends Entity
  12. {
  13. public $id,$label,$owner,$state,$public,$slug;
  14. protected $fields =
  15. array(
  16. 'id' => 'key',
  17. 'label' => 'string',
  18. 'owner' => 'int',
  19. 'state' => 'int',
  20. 'public' => 'int',
  21. 'slug' => 'string',
  22. );
  23. public function save()
  24. {
  25. if ($this->id == 0) {
  26. $this->slug = slugify($this->label);
  27. }
  28. parent::save();
  29. }
  30. }