original_string: protected function enforce_dependencies() {
          // Get the plan.
          $plan = $this->controller->get_plan();
          // Get the tasks as a var so we can iterate by reference.
          $tasks = $plan->get_tasks();
          $changes = 0;
          foreach ($tasks as &$task) {
              // Store as a var so we can iterate by reference.
              $settings = $task->get_settings();
              foreach ($settings as &$setting) {
                  // Get all dependencies for iteration by reference.
                  $dependencies = $setting->get_dependencies();
                  foreach ($dependencies as &$dependency) {
                      // Enforce each dependency.
                      if ($dependency->enforce()) {
                          $changes++;
                      }
                  }
              }
          }
          // Store the number of settings that changed through enforcement.
          $this->dependencychanges = $changes;
          return ($changes > 0);
      }
code: protected function enforce_dependencies() {
          // Get the plan.
          $plan = $this->controller->get_plan();
          // Get the tasks as a var so we can iterate by reference.
          $tasks = $plan->get_tasks();
          $changes = 0;
          foreach ($tasks as &$task) {
              // Store as a var so we can iterate by reference.
              $settings = $task->get_settings();
              foreach ($settings as &$setting) {
                  // Get all dependencies for iteration by reference.
                  $dependencies = $setting->get_dependencies();
                  foreach ($dependencies as &$dependency) {
                      // Enforce each dependency.
                      if ($dependency->enforce()) {
                          $changes++;
                      }
                  }
              }
          }
          // Store the number of settings that changed through enforcement.
          $this->dependencychanges = $changes;
          return ($changes > 0);
      }
code_tokens: protected function enforce_dependencies ( ) { // Get the plan. $ plan = $ this -> controller -> get_plan ( ) ; // Get the tasks as a var so we can iterate by reference. $ tasks = $ plan -> get_tasks ( ) ; $ changes = 0 ; foreach ( $ tasks as & $ task ) { // Store as a var so we can iterate by reference. $ settings = $ task -> get_settings ( ) ; foreach ( $ settings as & $ setting ) { // Get all dependencies for iteration by reference. $ dependencies = $ setting -> get_dependencies ( ) ; foreach ( $ dependencies as & $ dependency ) { // Enforce each dependency. if ( $ dependency -> enforce ( ) ) { $ changes ++ ; } } } } // Store the number of settings that changed through enforcement. $ this -> dependencychanges = $ changes ; return ( $ changes > 0 ) ; }
docstring: Enforces dependencies on all settings. Call before save
  @return bool True if dependencies were enforced and changes were made
docstring_tokens: Enforces dependencies on all settings . Call before save