* @since 1.0.0.0 */ abstract class HistorizedModel extends Model implements iHistorized { public $created_at; public $created_by_id; public $created_by_name; public $modified_at; public $modified_by_id; public $modified_by_name; // create public function getCreatedAt() { return $this->created_at; } public function setCreatedAt($timestamp) { $this->created_at = $timestamp; } public function getCreatedById() { return $this->created_by; } public function setCreatedById($id) { $this->created_by_id = $id; } public function getCreatedByName() { return $this->created_by_name; } public function setCreatedByName($name) { $this->created_by_name = $name; } public function setCreatedBy(iUser $user) { $this->setCreatedById($user->id); $this->setCreatedByName($user->login); } // modify public function getModifiedAt() { return $this->modified_at; } public function setModifiedAt($timestamp) { $this->modified_at = $timestamp; } public function getModifiedById() { return $this->modified_by_id; } public function setModifiedById($id) { $this->modified_by_id = $id; } public function getModifiedByName() { return $this->modified_by_name; } public function setModifiedByName($name) { $this->modified_by_name = $name; } public function setModifiedBy(iUser $user) { $this->setModifiedById($user->id); $this->setModifiedByName($user->login); } // delete public function getDeletedAt() { return $this->deleted_at; } public function setDeletedAt($timestamp) { $this->deleted_at = $timestamp; } public function getDeletedById() { return $this->deleted_by_id; } public function setDeletedById($id) { $this->deleted_by_id = $id; } public function getDeletedByName() { return $this->deleted_by_name; } public function setDeletedByName($name) { $this->deleted_by_name = $name; } public function setDeletedBy(iUser $user) { $this->setDeletedById($user->id); $this->setDeletedByName($user->login); } public static function fieldInfo() { $fields = parent::fieldInfo(); $fields['created_at'] = 'datetime'; $fields['created_by_id'] = 'int'; $fields['created_by_name'] = 'char'; $fields['modified_at'] = 'datetime'; $fields['modified_by_id'] = 'int'; $fields['modified_by_name'] = 'char'; $fields['deleted_at'] = 'datetime'; $fields['deleted_by_id'] = 'int'; $fields['deleted_by_name'] = 'char'; return $fields; } }