protected function execute($arguments = array(), $options = array())
 {
     // initialize the database connection
     $databaseManager = new sfDatabaseManager($this->configuration);
     $connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
     $this->createContextInstance();
     $c1 = new Criteria();
     $career_school_year = CareerSchoolYearPeer::retrieveBySchoolYear();
     $c1->add(StudentCareerSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, $career_school_year[0]->getId());
     $c1->add(StudentCareerSchoolYearPeer::STATUS, StudentCareerSchoolYearStatus::LAST_YEAR_REPPROVED);
     $students_career_school_year = StudentCareerSchoolYearPeer::doSelectJoinCareerSchoolYear($c1);
     foreach ($students_career_school_year as $student_career_school_year) {
         $this->logSection('STUDENT CAREER SCHOOL YEAR ID', $student_career_school_year->getId());
         $previous_school_year = SchoolYearPeer::retrieveLastYearSchoolYear($student_career_school_year->getCareerSchoolYear()->getSchoolYear());
         if (is_null($previous_school_year)) {
             $this->logSection('action', 'continue');
             continue;
         }
         $c = new Criteria();
         $c->add(StudentCareerSchoolYearPeer::STUDENT_ID, $student_career_school_year->getStudent()->getId());
         $c->addJoin(StudentCareerSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, CareerSchoolYearPeer::ID, Criteria::INNER_JOIN);
         $c->addJoin(CareerSchoolYearPeer::CAREER_ID, CareerPeer::ID, Criteria::INNER_JOIN);
         $c->add(CareerSchoolYearPeer::SCHOOL_YEAR_ID, $previous_school_year->getId());
         $c->add(StudentCareerSchoolYearPeer::STATUS, StudentCareerSchoolYearStatus::APPROVED);
         if (StudentCareerSchoolYearPeer::doCount($c)) {
             $this->logSection('action', 'fix');
             $student_career_school_year->setStatus(StudentCareerSchoolYearStatus::IN_COURSE);
             $student_career_school_year->save();
         }
     }
 }