- Timestamp:
- 04/26/10 16:26:04 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostropheBlogPlugin/trunk/lib/model/doctrine/PluginaBlogItem.class.php
r1046 r1062 12 12 */ 13 13 abstract class PluginaBlogItem extends BaseaBlogItem 14 { 14 { 15 protected $update = true; 16 15 17 /** 16 18 * These date methods are use in the routing of the permalink … … 51 53 $this->slug = 'untitled-'.$this['id']; 52 54 $this->title = 'untitled'; 55 $this['slug_saved'] = false; 56 $this->update = false; 53 57 $this->save(); 58 } 59 60 public function preUpdate($event) 61 { 62 if($this->update) 63 { 64 if(array_key_exists('slug', $this->getModified())) 65 { 66 $this['slug_saved'] = true; 67 } 68 if($this['slug_saved'] == false) 69 { 70 $this['slug'] = aTools::slugify($this['title']); 71 } 72 } 54 73 } 55 74

