public function getStudentEducationHistorysJoinDegree($criteria = null, $con = null) { include_once 'lib/model/om/BaseStudentEducationHistoryPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collStudentEducationHistorys === null) { if ($this->isNew()) { $this->collStudentEducationHistorys = array(); } else { $criteria->add(StudentEducationHistoryPeer::SCHOOL_ID, $this->getId()); $this->collStudentEducationHistorys = StudentEducationHistoryPeer::doSelectJoinDegree($criteria, $con); } } else { $criteria->add(StudentEducationHistoryPeer::SCHOOL_ID, $this->getId()); if (!isset($this->lastStudentEducationHistoryCriteria) || !$this->lastStudentEducationHistoryCriteria->equals($criteria)) { $this->collStudentEducationHistorys = StudentEducationHistoryPeer::doSelectJoinDegree($criteria, $con); } } $this->lastStudentEducationHistoryCriteria = $criteria; return $this->collStudentEducationHistorys; }
public function executeDelete() { $student_education_history = StudentEducationHistoryPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_education_history); $ref_error = 0; foreach ($student_education_history->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $student_education_history->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('student_education_history/delete/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('student_education_history/delete?student_id=' . $student_education_history->getStudentId(), '_ERR_DELETE_ (' . $student_education_history->toString() . ' - id:' . $student_education_history->getId() . ')'); } else { $student_education_history->delete(); } return $this->forward('student_education_history', 'list'); }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(StudentEducationHistoryPeer::ID, $pks, Criteria::IN); $objs = StudentEducationHistoryPeer::doSelect($criteria, $con); } return $objs; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = StudentEducationHistoryPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setStudentId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setSchoolId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setInDate($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setOutDate($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setCertificationNo($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setDegreeId($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setLeaveReason($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setStudyLength($arr[$keys[8]]); } }