Example #1
0
 public function save($new = false)
 {
     $objectName = $this->_changeSetName ? $this->_changeSetName : get_class($this);
     $objectName .= '_Changeset';
     if (!$this->{$this->idVar()} && $this->_changeOptions['created']) {
         $saveCreated = true;
     }
     // save changes
     if ($this->{$this->idVar()}) {
         $this->_changeSet = new $objectName(Cana_Changeset::save($this, $this->changeOptions() ? $this->changeOptions() : null));
     }
     parent::save();
     // save that it was created
     if ($saveCreated) {
         $this->_changeSet = new $objectName(Cana_Changeset::save($this, $this->changeOptions() ? $this->changeOptions() : null));
     }
 }