Changeset 7815
- Timestamp:
- Jul 23, 2008, 7:40:06 PM (13 years ago)
- Location:
- OpenPNE3/trunk
- Files:
-
- 5 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/trunk/data/sql/lib.model.schema.sql
r7811 r7815 19 19 )Type=InnoDB; 20 20 21 #----------------------------------------------------------------------------- 22 #-- authentication_pc_address 23 #----------------------------------------------------------------------------- 24 25 DROP TABLE IF EXISTS `authentication_pc_address`; 26 27 28 CREATE TABLE `authentication_pc_address` 29 ( 30 `id` INTEGER NOT NULL AUTO_INCREMENT, 31 `member_id` INTEGER, 32 `pc_address` VARCHAR(128), 33 `password` VARCHAR(32), 34 PRIMARY KEY (`id`), 35 UNIQUE KEY `authentication_pc_address_U_1` (`pc_address`), 36 INDEX `authentication_pc_address_FI_1` (`member_id`), 37 CONSTRAINT `authentication_pc_address_FK_1` 38 FOREIGN KEY (`member_id`) 39 REFERENCES `member` (`id`) 40 )Type=InnoDB; 41 21 42 # This restores the fkey checks, after having unset them earlier 22 43 SET FOREIGN_KEY_CHECKS = 1; -
OpenPNE3/trunk/lib/model/om/BaseMember.php
r7811 r7815 19 19 20 20 protected $updated_at; 21 22 23 protected $collAuthenticationPcAddresss; 24 25 26 protected $lastAuthenticationPcAddressCriteria = null; 21 27 22 28 … … 218 224 $this->resetModified(); } 219 225 226 if ($this->collAuthenticationPcAddresss !== null) { 227 foreach($this->collAuthenticationPcAddresss as $referrerFK) { 228 if (!$referrerFK->isDeleted()) { 229 $affectedRows += $referrerFK->save($con); 230 } 231 } 232 } 233 220 234 $this->alreadyInSave = false; 221 235 } … … 258 272 } 259 273 274 275 if ($this->collAuthenticationPcAddresss !== null) { 276 foreach($this->collAuthenticationPcAddresss as $referrerFK) { 277 if (!$referrerFK->validate($columns)) { 278 $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); 279 } 280 } 281 } 260 282 261 283 … … 378 400 379 401 402 if ($deepCopy) { 403 $copyObj->setNew(false); 404 405 foreach($this->getAuthenticationPcAddresss() as $relObj) { 406 $copyObj->addAuthenticationPcAddress($relObj->copy($deepCopy)); 407 } 408 409 } 410 380 411 $copyObj->setNew(true); 381 412 … … 401 432 } 402 433 434 435 public function initAuthenticationPcAddresss() 436 { 437 if ($this->collAuthenticationPcAddresss === null) { 438 $this->collAuthenticationPcAddresss = array(); 439 } 440 } 441 442 443 public function getAuthenticationPcAddresss($criteria = null, $con = null) 444 { 445 if ($criteria === null) { 446 $criteria = new Criteria(); 447 } 448 elseif ($criteria instanceof Criteria) 449 { 450 $criteria = clone $criteria; 451 } 452 453 if ($this->collAuthenticationPcAddresss === null) { 454 if ($this->isNew()) { 455 $this->collAuthenticationPcAddresss = array(); 456 } else { 457 458 $criteria->add(AuthenticationPcAddressPeer::MEMBER_ID, $this->getId()); 459 460 AuthenticationPcAddressPeer::addSelectColumns($criteria); 461 $this->collAuthenticationPcAddresss = AuthenticationPcAddressPeer::doSelect($criteria, $con); 462 } 463 } else { 464 if (!$this->isNew()) { 465 466 467 $criteria->add(AuthenticationPcAddressPeer::MEMBER_ID, $this->getId()); 468 469 AuthenticationPcAddressPeer::addSelectColumns($criteria); 470 if (!isset($this->lastAuthenticationPcAddressCriteria) || !$this->lastAuthenticationPcAddressCriteria->equals($criteria)) { 471 $this->collAuthenticationPcAddresss = AuthenticationPcAddressPeer::doSelect($criteria, $con); 472 } 473 } 474 } 475 $this->lastAuthenticationPcAddressCriteria = $criteria; 476 return $this->collAuthenticationPcAddresss; 477 } 478 479 480 public function countAuthenticationPcAddresss($criteria = null, $distinct = false, $con = null) 481 { 482 if ($criteria === null) { 483 $criteria = new Criteria(); 484 } 485 elseif ($criteria instanceof Criteria) 486 { 487 $criteria = clone $criteria; 488 } 489 490 $criteria->add(AuthenticationPcAddressPeer::MEMBER_ID, $this->getId()); 491 492 return AuthenticationPcAddressPeer::doCount($criteria, $distinct, $con); 493 } 494 495 496 public function addAuthenticationPcAddress(AuthenticationPcAddress $l) 497 { 498 $this->collAuthenticationPcAddresss[] = $l; 499 $l->setMember($this); 500 } 501 403 502 }
Note: See TracChangeset
for help on using the changeset viewer.