Example #1
0
 public function getVRaportPrintsJoinAcademicCalendar($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseVRaportPrintPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVRaportPrints === null) {
         if ($this->isNew()) {
             $this->collVRaportPrints = array();
         } else {
             $criteria->add(VRaportPrintPeer::SUBJECT_ID, $this->getId());
             $this->collVRaportPrints = VRaportPrintPeer::doSelectJoinAcademicCalendar($criteria, $con);
         }
     } else {
         $criteria->add(VRaportPrintPeer::SUBJECT_ID, $this->getId());
         if (!isset($this->lastVRaportPrintCriteria) || !$this->lastVRaportPrintCriteria->equals($criteria)) {
             $this->collVRaportPrints = VRaportPrintPeer::doSelectJoinAcademicCalendar($criteria, $con);
         }
     }
     $this->lastVRaportPrintCriteria = $criteria;
     return $this->collVRaportPrints;
 }
Example #2
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = VRaportPrintPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setStudentId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setSubjectId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setAcademicCalendarId($arr[$keys[2]]);
     }
 }
Example #3
0
 public static function doValidate(VRaportPrint $obj, $cols = null)
 {
     $columns = array();
     if ($cols) {
         $dbMap = Propel::getDatabaseMap(VRaportPrintPeer::DATABASE_NAME);
         $tableMap = $dbMap->getTable(VRaportPrintPeer::TABLE_NAME);
         if (!is_array($cols)) {
             $cols = array($cols);
         }
         foreach ($cols as $colName) {
             if ($tableMap->containsColumn($colName)) {
                 $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
                 $columns[$colName] = $obj->{$get}();
             }
         }
     } else {
     }
     $res = BasePeer::doValidate(VRaportPrintPeer::DATABASE_NAME, VRaportPrintPeer::TABLE_NAME, $columns);
     if ($res !== true) {
         $request = sfContext::getInstance()->getRequest();
         foreach ($res as $failed) {
             $col = VRaportPrintPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
             $request->setError($col, $failed->getMessage());
         }
     }
     return $res;
 }