Ejemplo n.º 1
0
 public function getSubjectTransfersJoinSubject($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseSubjectTransferPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collSubjectTransfers === null) {
         if ($this->isNew()) {
             $this->collSubjectTransfers = array();
         } else {
             $criteria->add(SubjectTransferPeer::GRADE_CONVERSION_ID, $this->getId());
             $this->collSubjectTransfers = SubjectTransferPeer::doSelectJoinSubject($criteria, $con);
         }
     } else {
         $criteria->add(SubjectTransferPeer::GRADE_CONVERSION_ID, $this->getId());
         if (!isset($this->lastSubjectTransferCriteria) || !$this->lastSubjectTransferCriteria->equals($criteria)) {
             $this->collSubjectTransfers = SubjectTransferPeer::doSelectJoinSubject($criteria, $con);
         }
     }
     $this->lastSubjectTransferCriteria = $criteria;
     return $this->collSubjectTransfers;
 }
Ejemplo n.º 2
0
 public function executeDelete()
 {
     $subject_transfer = SubjectTransferPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($subject_transfer);
     $ref_error = 0;
     foreach ($subject_transfer->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $subject_transfer->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('subject_transfer/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('subject_transfer/delete', '_ERR_DELETE_ (' . $subject_transfer->toString() . ' - id:' . $subject_transfer->getId() . ')');
     } else {
         $subject_transfer->delete();
     }
     $this->getRequest()->setParameter('test_applicant_id', $this->getRequestParameter('test_applicant_id'));
     return $this->forward('subject_transfer', 'list');
 }
Ejemplo n.º 3
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = SubjectTransferPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setCredit($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setGradeConversionId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setTestApplicantId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setSubjectId($arr[$keys[4]]);
     }
 }
Ejemplo n.º 4
0
 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(SubjectTransferPeer::ID, $pks, Criteria::IN);
         $objs = SubjectTransferPeer::doSelect($criteria, $con);
     }
     return $objs;
 }