ID; } // }}} // {{{ isEnabled /** * Check wheter an object has an enabled status or set the flag * * @param bool $newValue (optional) Set new enabled-Status * * @access public * @return bool **/ public function isEnabled ($newValue = null) { trigger_error (twIf_i18n::getText ('isEnabled not implemented, asuming always false'), E_USER_WARNING); return false; } // }}} // {{{ checkUpdate /** * Determine if an object should be stored / has pending updates * * @access public * @return bool **/ public function checkUpdate () { return $this->wasChanged; } // }}} // {{{ update /** * Set new value on an object * * @param string $Name Name of the value * @param mixed $Value New Value * @param bool $Commit (optional) Commit changes directly * * @access public * @return bool **/ public function update ($Name, $Value, $Commit = false) { // Check if there is such property if (!isset ($this->$Name) && !empty ($this->$Name)) return false; // Check if there is no change if ($this->$Name == $Value) return true; if ($Name == 'ID') trigger_error (twIf_i18n::getText ('You are about to change a primary identifier, hopefully you are sure what you are doing'), E_USER_WARNING); // Update $oldValue = $this->$Name; $this->$Name = $Value; if ($Commit && !$this->commit ()) { $this->$Name = $oldValue; tigger_error (twIf_i18n::getText ('Could not commit, restoring')); return false; } $this->wasChanged = true; return true; } // }}} // {{{ commit /** * Save changes on this object to disk or any other storage * * @access public * @return bool **/ public function commit () { trigger_error (twIf_i18n::getText ('commit is not implemented, objects will not persist'), E_USER_WARNING); return true; } // }}} // {{{ remove /** * Remove this object from its storages * * @access public * @return bool false if failed, true if success immediatly, null if success but delayed **/ public function remove () { trigger_error (twIf_i18n::getText ('remove is not implemented'), E_USER_WARNING); return false; } // }}} } ?>