public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = VStudentTypePeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setAcademicCalendarId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setPayerTypeId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setDepartmentId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setTotalStudent($arr[$keys[3]]); } }
public static function doValidate(VStudentType $obj, $cols = null) { $columns = array(); if ($cols) { $dbMap = Propel::getDatabaseMap(VStudentTypePeer::DATABASE_NAME); $tableMap = $dbMap->getTable(VStudentTypePeer::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(VStudentTypePeer::DATABASE_NAME, VStudentTypePeer::TABLE_NAME, $columns); if ($res !== true) { $request = sfContext::getInstance()->getRequest(); foreach ($res as $failed) { $col = VStudentTypePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); $request->setError($col, $failed->getMessage()); } } return $res; }
public function getVStudentTypesJoinDepartment($criteria = null, $con = null) { include_once 'lib/model/om/BaseVStudentTypePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVStudentTypes === null) { if ($this->isNew()) { $this->collVStudentTypes = array(); } else { $criteria->add(VStudentTypePeer::PAYER_TYPE_ID, $this->getId()); $this->collVStudentTypes = VStudentTypePeer::doSelectJoinDepartment($criteria, $con); } } else { $criteria->add(VStudentTypePeer::PAYER_TYPE_ID, $this->getId()); if (!isset($this->lastVStudentTypeCriteria) || !$this->lastVStudentTypeCriteria->equals($criteria)) { $this->collVStudentTypes = VStudentTypePeer::doSelectJoinDepartment($criteria, $con); } } $this->lastVStudentTypeCriteria = $criteria; return $this->collVStudentTypes; }