[289] | 1 | <?php |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | abstract class BaseTblblogcheckinfo extends BaseObject implements Persistent { |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | protected static $peer; |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | protected $ci_userid; |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | protected $ci_birthday; |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | protected $ci_phone; |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | protected $ci_pr; |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | protected $ci_numberid; |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | protected $ci_position; |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | protected $ci_school; |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | protected $ci_district; |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | protected $ci_province; |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | protected $ci_badge; |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | protected $ci_subject; |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | protected $ci_score; |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | protected $aTbluser; |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | protected $alreadyInSave = false; |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | protected $alreadyInValidation = false; |
---|
| 54 | |
---|
| 55 | |
---|
| 56 | public function __construct() |
---|
| 57 | { |
---|
| 58 | parent::__construct(); |
---|
| 59 | $this->applyDefaultValues(); |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | public function applyDefaultValues() |
---|
| 64 | { |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | public function getCiUserid() |
---|
| 69 | { |
---|
| 70 | return $this->ci_userid; |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | public function getCiBirthday($format = '%x') |
---|
| 75 | { |
---|
| 76 | if ($this->ci_birthday === null) { |
---|
| 77 | return null; |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | |
---|
| 81 | if ($this->ci_birthday === '0000-00-00') { |
---|
| 82 | return null; |
---|
| 83 | } else { |
---|
| 84 | try { |
---|
| 85 | $dt = new DateTime($this->ci_birthday); |
---|
| 86 | } catch (Exception $x) { |
---|
| 87 | throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ci_birthday, true), $x); |
---|
| 88 | } |
---|
| 89 | } |
---|
| 90 | |
---|
| 91 | if ($format === null) { |
---|
| 92 | return $dt; |
---|
| 93 | } elseif (strpos($format, '%') !== false) { |
---|
| 94 | return strftime($format, $dt->format('U')); |
---|
| 95 | } else { |
---|
| 96 | return $dt->format($format); |
---|
| 97 | } |
---|
| 98 | } |
---|
| 99 | |
---|
| 100 | |
---|
| 101 | public function getCiPhone() |
---|
| 102 | { |
---|
| 103 | return $this->ci_phone; |
---|
| 104 | } |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | public function getCiPr() |
---|
| 108 | { |
---|
| 109 | return $this->ci_pr; |
---|
| 110 | } |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | public function getCiNumberid() |
---|
| 114 | { |
---|
| 115 | return $this->ci_numberid; |
---|
| 116 | } |
---|
| 117 | |
---|
| 118 | |
---|
| 119 | public function getCiPosition() |
---|
| 120 | { |
---|
| 121 | return $this->ci_position; |
---|
| 122 | } |
---|
| 123 | |
---|
| 124 | |
---|
| 125 | public function getCiSchool() |
---|
| 126 | { |
---|
| 127 | return $this->ci_school; |
---|
| 128 | } |
---|
| 129 | |
---|
| 130 | |
---|
| 131 | public function getCiDistrict() |
---|
| 132 | { |
---|
| 133 | return $this->ci_district; |
---|
| 134 | } |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | public function getCiProvince() |
---|
| 138 | { |
---|
| 139 | return $this->ci_province; |
---|
| 140 | } |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | public function getCiBadge() |
---|
| 144 | { |
---|
| 145 | return $this->ci_badge; |
---|
| 146 | } |
---|
| 147 | |
---|
| 148 | |
---|
| 149 | public function getCiSubject() |
---|
| 150 | { |
---|
| 151 | return $this->ci_subject; |
---|
| 152 | } |
---|
| 153 | |
---|
| 154 | |
---|
| 155 | public function getCiScore() |
---|
| 156 | { |
---|
| 157 | return $this->ci_score; |
---|
| 158 | } |
---|
| 159 | |
---|
| 160 | |
---|
| 161 | public function setCiUserid($v) |
---|
| 162 | { |
---|
| 163 | if ($v !== null) { |
---|
| 164 | $v = (int) $v; |
---|
| 165 | } |
---|
| 166 | |
---|
| 167 | if ($this->ci_userid !== $v) { |
---|
| 168 | $this->ci_userid = $v; |
---|
| 169 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_USERID; |
---|
| 170 | } |
---|
| 171 | |
---|
| 172 | if ($this->aTbluser !== null && $this->aTbluser->getUsId() !== $v) { |
---|
| 173 | $this->aTbluser = null; |
---|
| 174 | } |
---|
| 175 | |
---|
| 176 | return $this; |
---|
| 177 | } |
---|
| 178 | |
---|
| 179 | public function setCiBirthday($v) |
---|
| 180 | { |
---|
| 181 | if ($v === null || $v === '') { |
---|
| 182 | $dt = null; |
---|
| 183 | } elseif ($v instanceof DateTime) { |
---|
| 184 | $dt = $v; |
---|
| 185 | } else { |
---|
| 186 | try { |
---|
| 187 | if (is_numeric($v)) { $dt = new DateTime('@'.$v, new DateTimeZone('UTC')); |
---|
| 188 | $dt->setTimeZone(new DateTimeZone(date_default_timezone_get())); |
---|
| 189 | } else { |
---|
| 190 | $dt = new DateTime($v); |
---|
| 191 | } |
---|
| 192 | } catch (Exception $x) { |
---|
| 193 | throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x); |
---|
| 194 | } |
---|
| 195 | } |
---|
| 196 | |
---|
| 197 | if ( $this->ci_birthday !== null || $dt !== null ) { |
---|
| 198 | |
---|
| 199 | $currNorm = ($this->ci_birthday !== null && $tmpDt = new DateTime($this->ci_birthday)) ? $tmpDt->format('Y-m-d') : null; |
---|
| 200 | $newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null; |
---|
| 201 | |
---|
| 202 | if ( ($currNorm !== $newNorm) ) |
---|
| 203 | { |
---|
| 204 | $this->ci_birthday = ($dt ? $dt->format('Y-m-d') : null); |
---|
| 205 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_BIRTHDAY; |
---|
| 206 | } |
---|
| 207 | } |
---|
| 208 | return $this; |
---|
| 209 | } |
---|
| 210 | |
---|
| 211 | public function setCiPhone($v) |
---|
| 212 | { |
---|
| 213 | if ($v !== null) { |
---|
| 214 | $v = (string) $v; |
---|
| 215 | } |
---|
| 216 | |
---|
| 217 | if ($this->ci_phone !== $v) { |
---|
| 218 | $this->ci_phone = $v; |
---|
| 219 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_PHONE; |
---|
| 220 | } |
---|
| 221 | |
---|
| 222 | return $this; |
---|
| 223 | } |
---|
| 224 | |
---|
| 225 | public function setCiPr($v) |
---|
| 226 | { |
---|
| 227 | if ($v !== null) { |
---|
| 228 | $v = (string) $v; |
---|
| 229 | } |
---|
| 230 | |
---|
| 231 | if ($this->ci_pr !== $v) { |
---|
| 232 | $this->ci_pr = $v; |
---|
| 233 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_PR; |
---|
| 234 | } |
---|
| 235 | |
---|
| 236 | return $this; |
---|
| 237 | } |
---|
| 238 | |
---|
| 239 | public function setCiNumberid($v) |
---|
| 240 | { |
---|
| 241 | if ($v !== null) { |
---|
| 242 | $v = (string) $v; |
---|
| 243 | } |
---|
| 244 | |
---|
| 245 | if ($this->ci_numberid !== $v) { |
---|
| 246 | $this->ci_numberid = $v; |
---|
| 247 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_NUMBERID; |
---|
| 248 | } |
---|
| 249 | |
---|
| 250 | return $this; |
---|
| 251 | } |
---|
| 252 | |
---|
| 253 | public function setCiPosition($v) |
---|
| 254 | { |
---|
| 255 | if ($v !== null) { |
---|
| 256 | $v = (int) $v; |
---|
| 257 | } |
---|
| 258 | |
---|
| 259 | if ($this->ci_position !== $v) { |
---|
| 260 | $this->ci_position = $v; |
---|
| 261 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_POSITION; |
---|
| 262 | } |
---|
| 263 | |
---|
| 264 | return $this; |
---|
| 265 | } |
---|
| 266 | |
---|
| 267 | public function setCiSchool($v) |
---|
| 268 | { |
---|
| 269 | if ($v !== null) { |
---|
| 270 | $v = (int) $v; |
---|
| 271 | } |
---|
| 272 | |
---|
| 273 | if ($this->ci_school !== $v) { |
---|
| 274 | $this->ci_school = $v; |
---|
| 275 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_SCHOOL; |
---|
| 276 | } |
---|
| 277 | |
---|
| 278 | return $this; |
---|
| 279 | } |
---|
| 280 | |
---|
| 281 | public function setCiDistrict($v) |
---|
| 282 | { |
---|
| 283 | if ($v !== null) { |
---|
| 284 | $v = (int) $v; |
---|
| 285 | } |
---|
| 286 | |
---|
| 287 | if ($this->ci_district !== $v) { |
---|
| 288 | $this->ci_district = $v; |
---|
| 289 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_DISTRICT; |
---|
| 290 | } |
---|
| 291 | |
---|
| 292 | return $this; |
---|
| 293 | } |
---|
| 294 | |
---|
| 295 | public function setCiProvince($v) |
---|
| 296 | { |
---|
| 297 | if ($v !== null) { |
---|
| 298 | $v = (int) $v; |
---|
| 299 | } |
---|
| 300 | |
---|
| 301 | if ($this->ci_province !== $v) { |
---|
| 302 | $this->ci_province = $v; |
---|
| 303 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_PROVINCE; |
---|
| 304 | } |
---|
| 305 | |
---|
| 306 | return $this; |
---|
| 307 | } |
---|
| 308 | |
---|
| 309 | public function setCiBadge($v) |
---|
| 310 | { |
---|
| 311 | if ($v !== null) { |
---|
| 312 | $v = (string) $v; |
---|
| 313 | } |
---|
| 314 | |
---|
| 315 | if ($this->ci_badge !== $v) { |
---|
| 316 | $this->ci_badge = $v; |
---|
| 317 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_BADGE; |
---|
| 318 | } |
---|
| 319 | |
---|
| 320 | return $this; |
---|
| 321 | } |
---|
| 322 | |
---|
| 323 | public function setCiSubject($v) |
---|
| 324 | { |
---|
| 325 | if ($v !== null) { |
---|
| 326 | $v = (string) $v; |
---|
| 327 | } |
---|
| 328 | |
---|
| 329 | if ($this->ci_subject !== $v) { |
---|
| 330 | $this->ci_subject = $v; |
---|
| 331 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_SUBJECT; |
---|
| 332 | } |
---|
| 333 | |
---|
| 334 | return $this; |
---|
| 335 | } |
---|
| 336 | |
---|
| 337 | public function setCiScore($v) |
---|
| 338 | { |
---|
| 339 | if ($v !== null) { |
---|
| 340 | $v = (int) $v; |
---|
| 341 | } |
---|
| 342 | |
---|
| 343 | if ($this->ci_score !== $v) { |
---|
| 344 | $this->ci_score = $v; |
---|
| 345 | $this->modifiedColumns[] = TblblogcheckinfoPeer::CI_SCORE; |
---|
| 346 | } |
---|
| 347 | |
---|
| 348 | return $this; |
---|
| 349 | } |
---|
| 350 | |
---|
| 351 | public function hasOnlyDefaultValues() |
---|
| 352 | { |
---|
| 353 | if (array_diff($this->modifiedColumns, array())) { |
---|
| 354 | return false; |
---|
| 355 | } |
---|
| 356 | |
---|
| 357 | return true; |
---|
| 358 | } |
---|
| 359 | |
---|
| 360 | public function hydrate($row, $startcol = 0, $rehydrate = false) |
---|
| 361 | { |
---|
| 362 | try { |
---|
| 363 | |
---|
| 364 | $this->ci_userid = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; |
---|
| 365 | $this->ci_birthday = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; |
---|
| 366 | $this->ci_phone = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; |
---|
| 367 | $this->ci_pr = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; |
---|
| 368 | $this->ci_numberid = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; |
---|
| 369 | $this->ci_position = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; |
---|
| 370 | $this->ci_school = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; |
---|
| 371 | $this->ci_district = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; |
---|
| 372 | $this->ci_province = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null; |
---|
| 373 | $this->ci_badge = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; |
---|
| 374 | $this->ci_subject = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; |
---|
| 375 | $this->ci_score = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null; |
---|
| 376 | $this->resetModified(); |
---|
| 377 | |
---|
| 378 | $this->setNew(false); |
---|
| 379 | |
---|
| 380 | if ($rehydrate) { |
---|
| 381 | $this->ensureConsistency(); |
---|
| 382 | } |
---|
| 383 | |
---|
| 384 | return $startcol + 12; |
---|
| 385 | } catch (Exception $e) { |
---|
| 386 | throw new PropelException("Error populating Tblblogcheckinfo object", $e); |
---|
| 387 | } |
---|
| 388 | } |
---|
| 389 | |
---|
| 390 | |
---|
| 391 | public function ensureConsistency() |
---|
| 392 | { |
---|
| 393 | |
---|
| 394 | if ($this->aTbluser !== null && $this->ci_userid !== $this->aTbluser->getUsId()) { |
---|
| 395 | $this->aTbluser = null; |
---|
| 396 | } |
---|
| 397 | } |
---|
| 398 | |
---|
| 399 | public function reload($deep = false, PropelPDO $con = null) |
---|
| 400 | { |
---|
| 401 | if ($this->isDeleted()) { |
---|
| 402 | throw new PropelException("Cannot reload a deleted object."); |
---|
| 403 | } |
---|
| 404 | |
---|
| 405 | if ($this->isNew()) { |
---|
| 406 | throw new PropelException("Cannot reload an unsaved object."); |
---|
| 407 | } |
---|
| 408 | |
---|
| 409 | if ($con === null) { |
---|
| 410 | $con = Propel::getConnection(TblblogcheckinfoPeer::DATABASE_NAME, Propel::CONNECTION_READ); |
---|
| 411 | } |
---|
| 412 | |
---|
| 413 | |
---|
| 414 | $stmt = TblblogcheckinfoPeer::doSelectStmt($this->buildPkeyCriteria(), $con); |
---|
| 415 | $row = $stmt->fetch(PDO::FETCH_NUM); |
---|
| 416 | $stmt->closeCursor(); |
---|
| 417 | if (!$row) { |
---|
| 418 | throw new PropelException('Cannot find matching row in the database to reload object values.'); |
---|
| 419 | } |
---|
| 420 | $this->hydrate($row, 0, true); |
---|
| 421 | if ($deep) { |
---|
| 422 | $this->aTbluser = null; |
---|
| 423 | } } |
---|
| 424 | |
---|
| 425 | |
---|
| 426 | public function delete(PropelPDO $con = null) |
---|
| 427 | { |
---|
| 428 | if ($this->isDeleted()) { |
---|
| 429 | throw new PropelException("This object has already been deleted."); |
---|
| 430 | } |
---|
| 431 | |
---|
| 432 | if ($con === null) { |
---|
| 433 | $con = Propel::getConnection(TblblogcheckinfoPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); |
---|
| 434 | } |
---|
| 435 | |
---|
| 436 | $con->beginTransaction(); |
---|
| 437 | try { |
---|
| 438 | TblblogcheckinfoPeer::doDelete($this, $con); |
---|
| 439 | $this->setDeleted(true); |
---|
| 440 | $con->commit(); |
---|
| 441 | } catch (PropelException $e) { |
---|
| 442 | $con->rollBack(); |
---|
| 443 | throw $e; |
---|
| 444 | } |
---|
| 445 | } |
---|
| 446 | |
---|
| 447 | |
---|
| 448 | public function save(PropelPDO $con = null) |
---|
| 449 | { |
---|
| 450 | if ($this->isDeleted()) { |
---|
| 451 | throw new PropelException("You cannot save an object that has been deleted."); |
---|
| 452 | } |
---|
| 453 | |
---|
| 454 | if ($con === null) { |
---|
| 455 | $con = Propel::getConnection(TblblogcheckinfoPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); |
---|
| 456 | } |
---|
| 457 | |
---|
| 458 | $con->beginTransaction(); |
---|
| 459 | try { |
---|
| 460 | $affectedRows = $this->doSave($con); |
---|
| 461 | $con->commit(); |
---|
| 462 | TblblogcheckinfoPeer::addInstanceToPool($this); |
---|
| 463 | return $affectedRows; |
---|
| 464 | } catch (PropelException $e) { |
---|
| 465 | $con->rollBack(); |
---|
| 466 | throw $e; |
---|
| 467 | } |
---|
| 468 | } |
---|
| 469 | |
---|
| 470 | |
---|
| 471 | protected function doSave(PropelPDO $con) |
---|
| 472 | { |
---|
| 473 | $affectedRows = 0; if (!$this->alreadyInSave) { |
---|
| 474 | $this->alreadyInSave = true; |
---|
| 475 | |
---|
| 476 | |
---|
| 477 | if ($this->aTbluser !== null) { |
---|
| 478 | if ($this->aTbluser->isModified() || $this->aTbluser->isNew()) { |
---|
| 479 | $affectedRows += $this->aTbluser->save($con); |
---|
| 480 | } |
---|
| 481 | $this->setTbluser($this->aTbluser); |
---|
| 482 | } |
---|
| 483 | |
---|
| 484 | |
---|
| 485 | if ($this->isModified()) { |
---|
| 486 | if ($this->isNew()) { |
---|
| 487 | $pk = TblblogcheckinfoPeer::doInsert($this, $con); |
---|
| 488 | $affectedRows += 1; |
---|
| 489 | $this->setNew(false); |
---|
| 490 | } else { |
---|
| 491 | $affectedRows += TblblogcheckinfoPeer::doUpdate($this, $con); |
---|
| 492 | } |
---|
| 493 | |
---|
| 494 | $this->resetModified(); } |
---|
| 495 | |
---|
| 496 | $this->alreadyInSave = false; |
---|
| 497 | |
---|
| 498 | } |
---|
| 499 | return $affectedRows; |
---|
| 500 | } |
---|
| 501 | |
---|
| 502 | protected $validationFailures = array(); |
---|
| 503 | |
---|
| 504 | |
---|
| 505 | public function getValidationFailures() |
---|
| 506 | { |
---|
| 507 | return $this->validationFailures; |
---|
| 508 | } |
---|
| 509 | |
---|
| 510 | |
---|
| 511 | public function validate($columns = null) |
---|
| 512 | { |
---|
| 513 | $res = $this->doValidate($columns); |
---|
| 514 | if ($res === true) { |
---|
| 515 | $this->validationFailures = array(); |
---|
| 516 | return true; |
---|
| 517 | } else { |
---|
| 518 | $this->validationFailures = $res; |
---|
| 519 | return false; |
---|
| 520 | } |
---|
| 521 | } |
---|
| 522 | |
---|
| 523 | |
---|
| 524 | protected function doValidate($columns = null) |
---|
| 525 | { |
---|
| 526 | if (!$this->alreadyInValidation) { |
---|
| 527 | $this->alreadyInValidation = true; |
---|
| 528 | $retval = null; |
---|
| 529 | |
---|
| 530 | $failureMap = array(); |
---|
| 531 | |
---|
| 532 | |
---|
| 533 | |
---|
| 534 | if ($this->aTbluser !== null) { |
---|
| 535 | if (!$this->aTbluser->validate($columns)) { |
---|
| 536 | $failureMap = array_merge($failureMap, $this->aTbluser->getValidationFailures()); |
---|
| 537 | } |
---|
| 538 | } |
---|
| 539 | |
---|
| 540 | |
---|
| 541 | if (($retval = TblblogcheckinfoPeer::doValidate($this, $columns)) !== true) { |
---|
| 542 | $failureMap = array_merge($failureMap, $retval); |
---|
| 543 | } |
---|
| 544 | |
---|
| 545 | |
---|
| 546 | |
---|
| 547 | $this->alreadyInValidation = false; |
---|
| 548 | } |
---|
| 549 | |
---|
| 550 | return (!empty($failureMap) ? $failureMap : true); |
---|
| 551 | } |
---|
| 552 | |
---|
| 553 | |
---|
| 554 | public function getByName($name, $type = BasePeer::TYPE_PHPNAME) |
---|
| 555 | { |
---|
| 556 | $pos = TblblogcheckinfoPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); |
---|
| 557 | $field = $this->getByPosition($pos); |
---|
| 558 | return $field; |
---|
| 559 | } |
---|
| 560 | |
---|
| 561 | |
---|
| 562 | public function getByPosition($pos) |
---|
| 563 | { |
---|
| 564 | switch($pos) { |
---|
| 565 | case 0: |
---|
| 566 | return $this->getCiUserid(); |
---|
| 567 | break; |
---|
| 568 | case 1: |
---|
| 569 | return $this->getCiBirthday(); |
---|
| 570 | break; |
---|
| 571 | case 2: |
---|
| 572 | return $this->getCiPhone(); |
---|
| 573 | break; |
---|
| 574 | case 3: |
---|
| 575 | return $this->getCiPr(); |
---|
| 576 | break; |
---|
| 577 | case 4: |
---|
| 578 | return $this->getCiNumberid(); |
---|
| 579 | break; |
---|
| 580 | case 5: |
---|
| 581 | return $this->getCiPosition(); |
---|
| 582 | break; |
---|
| 583 | case 6: |
---|
| 584 | return $this->getCiSchool(); |
---|
| 585 | break; |
---|
| 586 | case 7: |
---|
| 587 | return $this->getCiDistrict(); |
---|
| 588 | break; |
---|
| 589 | case 8: |
---|
| 590 | return $this->getCiProvince(); |
---|
| 591 | break; |
---|
| 592 | case 9: |
---|
| 593 | return $this->getCiBadge(); |
---|
| 594 | break; |
---|
| 595 | case 10: |
---|
| 596 | return $this->getCiSubject(); |
---|
| 597 | break; |
---|
| 598 | case 11: |
---|
| 599 | return $this->getCiScore(); |
---|
| 600 | break; |
---|
| 601 | default: |
---|
| 602 | return null; |
---|
| 603 | break; |
---|
| 604 | } } |
---|
| 605 | |
---|
| 606 | |
---|
| 607 | public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) |
---|
| 608 | { |
---|
| 609 | $keys = TblblogcheckinfoPeer::getFieldNames($keyType); |
---|
| 610 | $result = array( |
---|
| 611 | $keys[0] => $this->getCiUserid(), |
---|
| 612 | $keys[1] => $this->getCiBirthday(), |
---|
| 613 | $keys[2] => $this->getCiPhone(), |
---|
| 614 | $keys[3] => $this->getCiPr(), |
---|
| 615 | $keys[4] => $this->getCiNumberid(), |
---|
| 616 | $keys[5] => $this->getCiPosition(), |
---|
| 617 | $keys[6] => $this->getCiSchool(), |
---|
| 618 | $keys[7] => $this->getCiDistrict(), |
---|
| 619 | $keys[8] => $this->getCiProvince(), |
---|
| 620 | $keys[9] => $this->getCiBadge(), |
---|
| 621 | $keys[10] => $this->getCiSubject(), |
---|
| 622 | $keys[11] => $this->getCiScore(), |
---|
| 623 | ); |
---|
| 624 | return $result; |
---|
| 625 | } |
---|
| 626 | |
---|
| 627 | |
---|
| 628 | public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) |
---|
| 629 | { |
---|
| 630 | $pos = TblblogcheckinfoPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); |
---|
| 631 | return $this->setByPosition($pos, $value); |
---|
| 632 | } |
---|
| 633 | |
---|
| 634 | |
---|
| 635 | public function setByPosition($pos, $value) |
---|
| 636 | { |
---|
| 637 | switch($pos) { |
---|
| 638 | case 0: |
---|
| 639 | $this->setCiUserid($value); |
---|
| 640 | break; |
---|
| 641 | case 1: |
---|
| 642 | $this->setCiBirthday($value); |
---|
| 643 | break; |
---|
| 644 | case 2: |
---|
| 645 | $this->setCiPhone($value); |
---|
| 646 | break; |
---|
| 647 | case 3: |
---|
| 648 | $this->setCiPr($value); |
---|
| 649 | break; |
---|
| 650 | case 4: |
---|
| 651 | $this->setCiNumberid($value); |
---|
| 652 | break; |
---|
| 653 | case 5: |
---|
| 654 | $this->setCiPosition($value); |
---|
| 655 | break; |
---|
| 656 | case 6: |
---|
| 657 | $this->setCiSchool($value); |
---|
| 658 | break; |
---|
| 659 | case 7: |
---|
| 660 | $this->setCiDistrict($value); |
---|
| 661 | break; |
---|
| 662 | case 8: |
---|
| 663 | $this->setCiProvince($value); |
---|
| 664 | break; |
---|
| 665 | case 9: |
---|
| 666 | $this->setCiBadge($value); |
---|
| 667 | break; |
---|
| 668 | case 10: |
---|
| 669 | $this->setCiSubject($value); |
---|
| 670 | break; |
---|
| 671 | case 11: |
---|
| 672 | $this->setCiScore($value); |
---|
| 673 | break; |
---|
| 674 | } } |
---|
| 675 | |
---|
| 676 | |
---|
| 677 | public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) |
---|
| 678 | { |
---|
| 679 | $keys = TblblogcheckinfoPeer::getFieldNames($keyType); |
---|
| 680 | |
---|
| 681 | if (array_key_exists($keys[0], $arr)) $this->setCiUserid($arr[$keys[0]]); |
---|
| 682 | if (array_key_exists($keys[1], $arr)) $this->setCiBirthday($arr[$keys[1]]); |
---|
| 683 | if (array_key_exists($keys[2], $arr)) $this->setCiPhone($arr[$keys[2]]); |
---|
| 684 | if (array_key_exists($keys[3], $arr)) $this->setCiPr($arr[$keys[3]]); |
---|
| 685 | if (array_key_exists($keys[4], $arr)) $this->setCiNumberid($arr[$keys[4]]); |
---|
| 686 | if (array_key_exists($keys[5], $arr)) $this->setCiPosition($arr[$keys[5]]); |
---|
| 687 | if (array_key_exists($keys[6], $arr)) $this->setCiSchool($arr[$keys[6]]); |
---|
| 688 | if (array_key_exists($keys[7], $arr)) $this->setCiDistrict($arr[$keys[7]]); |
---|
| 689 | if (array_key_exists($keys[8], $arr)) $this->setCiProvince($arr[$keys[8]]); |
---|
| 690 | if (array_key_exists($keys[9], $arr)) $this->setCiBadge($arr[$keys[9]]); |
---|
| 691 | if (array_key_exists($keys[10], $arr)) $this->setCiSubject($arr[$keys[10]]); |
---|
| 692 | if (array_key_exists($keys[11], $arr)) $this->setCiScore($arr[$keys[11]]); |
---|
| 693 | } |
---|
| 694 | |
---|
| 695 | |
---|
| 696 | public function buildCriteria() |
---|
| 697 | { |
---|
| 698 | $criteria = new Criteria(TblblogcheckinfoPeer::DATABASE_NAME); |
---|
| 699 | |
---|
| 700 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_USERID)) $criteria->add(TblblogcheckinfoPeer::CI_USERID, $this->ci_userid); |
---|
| 701 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_BIRTHDAY)) $criteria->add(TblblogcheckinfoPeer::CI_BIRTHDAY, $this->ci_birthday); |
---|
| 702 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_PHONE)) $criteria->add(TblblogcheckinfoPeer::CI_PHONE, $this->ci_phone); |
---|
| 703 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_PR)) $criteria->add(TblblogcheckinfoPeer::CI_PR, $this->ci_pr); |
---|
| 704 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_NUMBERID)) $criteria->add(TblblogcheckinfoPeer::CI_NUMBERID, $this->ci_numberid); |
---|
| 705 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_POSITION)) $criteria->add(TblblogcheckinfoPeer::CI_POSITION, $this->ci_position); |
---|
| 706 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_SCHOOL)) $criteria->add(TblblogcheckinfoPeer::CI_SCHOOL, $this->ci_school); |
---|
| 707 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_DISTRICT)) $criteria->add(TblblogcheckinfoPeer::CI_DISTRICT, $this->ci_district); |
---|
| 708 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_PROVINCE)) $criteria->add(TblblogcheckinfoPeer::CI_PROVINCE, $this->ci_province); |
---|
| 709 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_BADGE)) $criteria->add(TblblogcheckinfoPeer::CI_BADGE, $this->ci_badge); |
---|
| 710 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_SUBJECT)) $criteria->add(TblblogcheckinfoPeer::CI_SUBJECT, $this->ci_subject); |
---|
| 711 | if ($this->isColumnModified(TblblogcheckinfoPeer::CI_SCORE)) $criteria->add(TblblogcheckinfoPeer::CI_SCORE, $this->ci_score); |
---|
| 712 | |
---|
| 713 | return $criteria; |
---|
| 714 | } |
---|
| 715 | |
---|
| 716 | |
---|
| 717 | public function buildPkeyCriteria() |
---|
| 718 | { |
---|
| 719 | $criteria = new Criteria(TblblogcheckinfoPeer::DATABASE_NAME); |
---|
| 720 | |
---|
| 721 | $criteria->add(TblblogcheckinfoPeer::CI_USERID, $this->ci_userid); |
---|
| 722 | |
---|
| 723 | return $criteria; |
---|
| 724 | } |
---|
| 725 | |
---|
| 726 | |
---|
| 727 | public function getPrimaryKey() |
---|
| 728 | { |
---|
| 729 | return $this->getCiUserid(); |
---|
| 730 | } |
---|
| 731 | |
---|
| 732 | |
---|
| 733 | public function setPrimaryKey($key) |
---|
| 734 | { |
---|
| 735 | $this->setCiUserid($key); |
---|
| 736 | } |
---|
| 737 | |
---|
| 738 | |
---|
| 739 | public function copyInto($copyObj, $deepCopy = false) |
---|
| 740 | { |
---|
| 741 | |
---|
| 742 | $copyObj->setCiUserid($this->ci_userid); |
---|
| 743 | |
---|
| 744 | $copyObj->setCiBirthday($this->ci_birthday); |
---|
| 745 | |
---|
| 746 | $copyObj->setCiPhone($this->ci_phone); |
---|
| 747 | |
---|
| 748 | $copyObj->setCiPr($this->ci_pr); |
---|
| 749 | |
---|
| 750 | $copyObj->setCiNumberid($this->ci_numberid); |
---|
| 751 | |
---|
| 752 | $copyObj->setCiPosition($this->ci_position); |
---|
| 753 | |
---|
| 754 | $copyObj->setCiSchool($this->ci_school); |
---|
| 755 | |
---|
| 756 | $copyObj->setCiDistrict($this->ci_district); |
---|
| 757 | |
---|
| 758 | $copyObj->setCiProvince($this->ci_province); |
---|
| 759 | |
---|
| 760 | $copyObj->setCiBadge($this->ci_badge); |
---|
| 761 | |
---|
| 762 | $copyObj->setCiSubject($this->ci_subject); |
---|
| 763 | |
---|
| 764 | $copyObj->setCiScore($this->ci_score); |
---|
| 765 | |
---|
| 766 | |
---|
| 767 | $copyObj->setNew(true); |
---|
| 768 | |
---|
| 769 | } |
---|
| 770 | |
---|
| 771 | |
---|
| 772 | public function copy($deepCopy = false) |
---|
| 773 | { |
---|
| 774 | $clazz = get_class($this); |
---|
| 775 | $copyObj = new $clazz(); |
---|
| 776 | $this->copyInto($copyObj, $deepCopy); |
---|
| 777 | return $copyObj; |
---|
| 778 | } |
---|
| 779 | |
---|
| 780 | |
---|
| 781 | public function getPeer() |
---|
| 782 | { |
---|
| 783 | if (self::$peer === null) { |
---|
| 784 | self::$peer = new TblblogcheckinfoPeer(); |
---|
| 785 | } |
---|
| 786 | return self::$peer; |
---|
| 787 | } |
---|
| 788 | |
---|
| 789 | |
---|
| 790 | public function setTbluser(Tbluser $v = null) |
---|
| 791 | { |
---|
| 792 | if ($v === null) { |
---|
| 793 | $this->setCiUserid(NULL); |
---|
| 794 | } else { |
---|
| 795 | $this->setCiUserid($v->getUsId()); |
---|
| 796 | } |
---|
| 797 | |
---|
| 798 | $this->aTbluser = $v; |
---|
| 799 | |
---|
| 800 | if ($v !== null) { |
---|
| 801 | $v->setTblblogcheckinfo($this); |
---|
| 802 | } |
---|
| 803 | |
---|
| 804 | return $this; |
---|
| 805 | } |
---|
| 806 | |
---|
| 807 | |
---|
| 808 | |
---|
| 809 | public function getTbluser(PropelPDO $con = null) |
---|
| 810 | { |
---|
| 811 | if ($this->aTbluser === null && ($this->ci_userid !== null)) { |
---|
| 812 | $this->aTbluser = TbluserPeer::retrieveByPK($this->ci_userid, $con); |
---|
| 813 | $this->aTbluser->setTblblogcheckinfo($this); |
---|
| 814 | } |
---|
| 815 | return $this->aTbluser; |
---|
| 816 | } |
---|
| 817 | |
---|
| 818 | |
---|
| 819 | public function clearAllReferences($deep = false) |
---|
| 820 | { |
---|
| 821 | if ($deep) { |
---|
| 822 | } |
---|
| 823 | $this->aTbluser = null; |
---|
| 824 | } |
---|
| 825 | |
---|
| 826 | } |
---|