Sketch.class.php 449 B

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