/** * Record class-specific differences. * 'orig' is the same as {@link $_object}, but is passed here for convenience. * @param JOURNAL $orig * @param JOURNAL $new * @access private */ protected function _record_differences($orig, $new) { parent::_record_differences($orig, $new); $this->_record_time_difference('Date', $orig->date, $new->date); if ($orig->weather_type != $new->weather_type) { $orig_weather = $orig->weather_icon_properties(); $new_weather = $new->weather_icon_properties(); $this->_record_string_difference('Weather type', $orig_weather->title, $new_weather->title); } if ($orig->hi_temp != $new->hi_temp) { $this->_record_string_difference('Low temperature', $orig->lo_temp, $new->lo_temp); } if ($orig->lo_temp != $new->lo_temp) { $this->_record_string_difference('High temperature', $orig->hi_temp, $new->hi_temp); } $this->_record_text_difference('Weather', $orig->weather, $new->weather); }
/** * Record class-specific differences. * 'orig' is the same as {@link $_object}, but is passed here for convenience. * @param RECIPE $orig * @param RECIPE $new * @access private */ protected function _record_differences($orig, $new) { parent::_record_differences($orig, $new); $this->_record_string_difference('Picture', $orig->picture_url, $new->picture_url); $this->_record_string_difference('Originator', $orig->originator, $new->originator); $this->_record_text_difference('Ingredients', $orig->ingredients, $new->ingredients); $this->_record_text_difference('Instructions', $orig->instructions, $new->instructions); if ($orig->bullet_ingredients != $new->bullet_ingredients) { if ($new->bullet_ingredients) { $this->record_difference('Set automatic bullets for ingredients.'); } else { $this->record_difference('Turned off automatic bullets for ingredients.'); } } if ($orig->number_instructions != $new->number_instructions) { if ($new->number_instructions) { $this->record_difference('Set automatic numbering for instructions.'); } else { $this->record_difference('Turned off automatic numbering for instructions.'); } } }
/** * Record class-specific differences. * 'orig' is the same as {@link $_object}, but is passed here for convenience. * @param PROJECT_ENTRY $orig * @param PROJECT_ENTRY $new * @access private */ protected function _record_differences($orig, $new) { parent::_record_differences($orig, $new); $this->_record_text_difference('Extra description', $orig->extra_description, $new->extra_description); if ($orig->kind != $new->kind) { $orig_title = $orig->kind_as_text(); $new_title = $new->kind_as_text(); $this->_record_string_difference('Kind', $orig_title, $new_title); } if ($orig->component_id != $new->component_id) { $orig_comp = $orig->component(); $new_comp = $new->component(); $this->_record_object_difference('Component', $orig_comp, $new_comp); } if ($this->compare_branches) { $orig_branches = $orig->stored_branch_infos(); $new_branches = $new->current_branch_infos(); if (sizeof($orig_branches)) { foreach ($orig_branches as $branch_id => $orig_branch) { if (!isset($new_branches[$branch_id])) { $this->record_difference('Removed from branch [' . $orig_branch->title_as_plain_text() . '].'); } else { $this->_record_branch_differences($orig_branch, $new_branches[$branch_id]); } } } if (sizeof($new_branches)) { foreach ($new_branches as $branch_id => $new_branch) { if (!isset($orig_branches[$branch_id])) { $this->record_difference('Added to branch [' . $new_branch->title_as_plain_text() . '].'); } } } } if ($orig->main_branch_id != $new->main_branch_id) { $this->_record_object_difference('Main branch', $orig->main_branch_info(), $new->main_branch_info()); } }