/** * Este metodo recupera el periodo padre de un curso bimestral y devuelve true si es el primero del cuatrimestre *Siempre va a exisistir solo un periodo padre distinto al que recupero, porque los cuatrimestres son siempre dos. * * @return boolean */ public function parentIsFirst() { $parent_period = CareerSchoolYearPeriodPeer::retrieveByPK($this->getPeriod()->getCareerSchoolYearPeriodId()); $c = new Criteria(); $c->add(CareerSchoolYearPeriodPeer::CAREER_SCHOOL_YEAR_ID, $parent_period->getCareerSchoolYearId()); $c->add(CareerSchoolYearPeriodPeer::COURSE_TYPE, $parent_period->getCourseType()); $c->add(CareerSchoolYearPeriodPeer::ID, $parent_period->getId(), Criteria::NOT_EQUAL); $compare_period = CareerSchoolYearPeriodPeer::doSelectOne($c); return $parent_period->getStartAt() < $compare_period->getStartAt(); }