Changeset 30
- Timestamp:
- 03/30/08 22:39:38
- Files:
-
- branches/jtexier/apps/main/modules/people/actions/actions.class.php (modified) (1 diff)
- branches/jtexier/apps/main/modules/sfGuardAuth/actions/actions.class.php (modified) (2 diffs)
- branches/jtexier/batch/convert_user_profile.php (added)
- branches/jtexier/config/schema.yml (modified) (1 diff)
- branches/jtexier/config/search.yml (modified) (1 diff)
- branches/jtexier/config/sfGuardPlugin_schema.custom.yml (modified) (1 diff)
- branches/jtexier/data/fixtures/data.yml (modified) (6 diffs)
- branches/jtexier/lib/model/Job.php (modified) (4 diffs)
- branches/jtexier/lib/model/PluginsfGuardUser.php (modified) (15 diffs)
- branches/jtexier/lib/model/PluginsfGuardUserPeer.php (modified) (1 diff)
- branches/jtexier/lib/model/UserProfile.php (added)
- branches/jtexier/lib/model/UserProfilePeer.php (added)
- branches/jtexier/plugins/sfGuardPlugin/lib/model/map/sfGuardUserMapBuilder.php (modified) (1 diff)
- branches/jtexier/plugins/sfGuardPlugin/lib/model/om/BasesfGuardUser.php (modified) (21 diffs)
- branches/jtexier/plugins/sfGuardPlugin/lib/model/om/BasesfGuardUserPeer.php (modified) (6 diffs)
- branches/jtexier/test/unit/KarmaTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/jtexier/apps/main/modules/people/actions/actions.class.php
r2 r30 83 83 { 84 84 $this->user = $this->getFromSlug('username'); 85 $this->getLogger('details_user ' . $this->user->getUsername() ); 85 86 $this->is_current_user = $this->getUser()->getId() == $this->user->getId(); 86 87 $this->has_recommended = $this->user->hasBeenRecommendedBy($this->getUser()->getId()); branches/jtexier/apps/main/modules/sfGuardAuth/actions/actions.class.php
r2 r30 151 151 { 152 152 $profile['avatar_path'] = $thumb; 153 } 154 $this->user-> fromArray($profile, BasePeer::TYPE_FIELDNAME);155 $localization = $this->user->get Localization();153 }$this->logMessage('ok'); 154 $this->user->getProfile()->fromArray($profile, BasePeer::TYPE_FIELDNAME); 155 $localization = $this->user->getProfile()->getLocalization(); 156 156 if ($profile['latitude'] && $profile['longitude']) 157 157 { … … 164 164 else 165 165 { 166 $this->user-> updateLocalization();167 } 168 $this->user-> save();166 $this->user->getProfile()->updateLocalization(); 167 } 168 $this->user->getProfile()->save(); 169 169 $this->purgePersonRelatedCache($this->user); 170 170 $this->setFlash('notice', $this->__('Your profile has been updated')); branches/jtexier/config/schema.yml
r2 r30 146 146 _indexes: 147 147 filter_index: [recommender_id, recommended_id, created_at] 148 149 user_profile: 150 _attributes: { phpName: UserProfile } 151 id: 152 user_id: { type: integer, foreignTable: sf_guard_user, foreignReference: id, onDelete: cascade } 153 display_name: { type: varchar, size: 255, index: true } 154 email: { type: varchar, size: 100, required: true } 155 avatar_path: { type: varchar, size: 40 } 156 trac_username: { type: varchar, size: 50 } 157 homepage: { type: varchar, size: 255 } 158 feed_url: varchar(255) 159 summary: longvarchar 160 php_at: timestamp 161 symfony_at: timestamp 162 birthdate: timestamp 163 address: longvarchar 164 zip: varchar(10) 165 city: { type: varchar, size: 50, required: true, index: true } 166 state: varchar(50) 167 country: { type: varchar, size: 2, required: true, index: true } 168 phone: varchar(20) 169 karma: { type: integer, default: 0, required: true, index: true } 170 is_validated: { type: boolean, default: 0 } 171 allow_contact: { type: boolean, default: 0 } 172 allow_localization: { type: boolean, default: 0 } 173 is_for_hire: { type: boolean, default: 0 } 174 created_at: 175 updated_at: 176 _uniques: 177 emails: [email] branches/jtexier/config/search.yml
r2 r30 86 86 description: summary 87 87 validator: getIsActive 88 sfGuardUser: 88 #sfGuardUser: 89 UserProfile: 89 90 fields: 90 username: text91 #username: text 91 92 displayName: 92 93 boost: 1.5 branches/jtexier/config/sfGuardPlugin_schema.custom.yml
r2 r30 1 1 propel: 2 2 3 sf_guard_user:4 _attributes: { phpName: sfGuardUser }5 display_name: { type: varchar, size: 255, index: true }6 email: { type: varchar, size: 100, required: true }7 avatar_path: { type: varchar, size: 40 }8 trac_username: { type: varchar, size: 50 }9 homepage: { type: varchar, size: 255 }10 feed_url: varchar(255)11 summary: longvarchar12 php_at: timestamp13 symfony_at: timestamp14 birthdate: timestamp15 address: longvarchar16 zip: varchar(10)17 city: { type: varchar, size: 50, required: true, index: true }18 state: varchar(50)19 country: { type: varchar, size: 2, required: true, index: true }20 phone: varchar(20)21 karma: { type: integer, default: 0, required: true, index: true }22 is_validated: { type: boolean, default: 0 }23 allow_contact: { type: boolean, default: 0 }24 allow_localization: { type: boolean, default: 0 }25 is_for_hire: { type: boolean, default: 0 }26 created_at:27 updated_at:28 _uniques:29 users: [username]30 emails: [email]branches/jtexier/data/fixtures/data.yml
r2 r30 2 2 fabpot: 3 3 username: fabpot 4 password: password 5 created_at: "2005-01-01 00:00:00" 6 niko: 7 username: niko 8 password: password 9 created_at: "2004-01-01 00:00:00" 10 mbertier: 11 username: mbertier 12 password: password 13 created_at: "2006-01-01 00:00:00" 14 francois: 15 username: francois 16 password: password 17 created_at: "2007-02-01 00:00:00" 18 johndoe: 19 username: johndoe 20 password: password 21 created_at: "2007-07-01 00:00:00" 22 unvalidated_person: 23 password: password 24 is_active: 0 25 created_at: "2007-12-01 00:00:00" 26 27 UserProfile: 28 fabpot: 29 user_id: fabpot 4 30 display_name: Fabien Potencier 5 31 summary: Father of the Symfony framework 6 password: password7 32 email: fabien@symfony-project.com 8 33 trac_username: fabien … … 14 39 is_for_hire: 0 15 40 avatar_path: samples/fabpot.png 16 created_at: "2005-01-01 00:00:00"17 41 niko: 18 user name: niko42 user_id: niko 19 43 display_name: Nicolas Perriault 20 password: password21 44 email: nperriault@gmail.com 22 45 trac_username: nicolas … … 37 60 is_for_hire: 1 38 61 avatar_path: samples/niko.jpg 39 created_at: "2004-01-01 00:00:00"40 62 mbertier: 41 user name: mbertier63 user_id: mbertier 42 64 display_name: Tristan Rivoallan 43 password: password44 65 email: tristan@rivoallan.net 45 66 trac_username: trivoallan … … 50 71 is_for_hire: 0 51 72 avatar_path: samples/mbertier.png 52 created_at: "2006-01-01 00:00:00"53 73 francois: 54 user name: francois74 user_id: francois 55 75 display_name: François Zaninotto 56 password: password57 76 email: fzaninotto@ma-generation.com 58 77 trac_username: francois … … 63 82 allow_localization: 0 64 83 is_for_hire: 0 65 created_at: "2007-02-01 00:00:00"66 84 johndoe: 67 username: johndoe 68 password: password 85 user_id: johndoe 69 86 email: john@doe.com 70 87 summary: "Super newbie" … … 74 91 allow_localization: 0 75 92 is_for_hire: 1 76 created_at: "2007-07-01 00:00:00"77 93 unvalidated_person: 78 username: I_shouldnt_appear 79 password: password 94 user_id: unvalidated_person 80 95 email: foo@bar.com 81 96 country: UK 82 97 is_validated: 0 83 is_active: 0 84 created_at: "2007-12-01 00:00:00" 98 85 99 86 100 BlogPost: branches/jtexier/lib/model/Job.php
r2 r30 87 87 $new = $this->isNew(); 88 88 $modified = $this->isModified(); 89 89 90 $affectedRows = parent::save($con); 90 91 91 if ($affectedRows > 0 && $this->getsfGuardUser()) 92 92 { … … 106 106 { 107 107 $event = new Event(); 108 108 109 if ($this->getCompanyId()) 109 110 { … … 118 119 $event->setSourceName($this->getsfGuardUser()->getDisplayName()); 119 120 } 121 120 122 $event->setTargetModel('Job'); 121 123 $event->setTargetSlug($this->getSlug()); … … 129 131 $event->setType('update'); 130 132 } 133 131 134 $event->save(); 132 135 } branches/jtexier/lib/model/PluginsfGuardUser.php
r23 r30 22 22 public function __toString() 23 23 { 24 return $this->get DisplayName();24 return $this->getProfile()->getDisplayName(); 25 25 } 26 26 … … 32 32 public function addSkill($skills) 33 33 { 34 return $this-> addTag($skills);34 return $this->getProfile()->addTag($skills); 35 35 } 36 36 … … 42 42 public function getAge() 43 43 { 44 $age = null; 45 if ($this->getBirthdate()) 46 { 47 $age = date("Y") - (int) $this->getBirthdate('Y'); 48 $month_diff = date("m") - (int) $this->getBirthdate('m'); 49 $day_diff = date("d") - (int) $this->getBirthdate('d'); 50 $age -= $day_diff < 0 || $month_diff < 0 ? 1 : 0; 51 } 52 return $age; 44 $this->getProfile()->getAge(); 45 } 46 47 /** 48 * Retrieves country name 49 * 50 * @return string 51 */ 52 public function getCountryName() 53 { 54 $this->getProfile()->getCountryName(); 53 55 } 54 56 … … 62 64 public function getAllowContact($check_jobs = false) 63 65 { 64 $allow = parent::getAllowContact();66 $allow = $this->getProfile()->getAllowContact(); 65 67 66 68 if ($check_jobs && $this->countJobs(new Criteria) > 0) … … 73 75 74 76 /** 75 * Retrieves companies associated with current user76 *77 * @param string $type Filter type (submitted, related, all)78 * @return array79 */80 public function getCompanies($type = 'submitted')81 {82 $c = new Criteria();83 $c->add(CompanyPeer::IS_ACTIVE, true);84 $c->addAscendingOrderByColumn(CompanyPeer::NAME);85 switch ($type)86 {87 case 'all':88 $companies = CompanyPeer::doSelect($c);89 break;90 case 'related':91 $c->addJoin(CompanyPersonPeer::COMPANY_ID, CompanyPeer::ID);92 $c->add(CompanyPersonPeer::USER_ID, $this->getId());93 $companies = CompanyPeer::doSelect($c);94 break;95 case 'submitted':96 default:97 $companies = $this->getCompanys($c);98 break;99 }100 return $companies;101 }102 103 /**104 * Retrieves simple hash of related companies. Useful for populating a select105 * html tag106 *107 * @param string $type Filter type (submitted, related, all)108 * @return array109 */110 public function getCompaniesArray($type = 'submitted')111 {112 $companies = array();113 foreach ($this->getCompanies($type) as $company)114 {115 $companies[$company->getId()] = $company->getName();116 }117 return $companies;118 }119 120 /**121 * Returns related companies string122 *123 * @param string $separator124 * @return string125 */126 public function getCompaniesString($separator = ', ')127 {128 $companies = array();129 foreach ($this->getCompanies('related') as $company)130 {131 $companies[] = $company->getName();132 }133 return implode($separator, $companies);134 }135 136 /**137 * Retrieves country name138 *139 * @return string140 */141 public function getCountryName()142 {143 if ($this->getCountry())144 {145 sfLoader::loadHelpers('I18N');146 return format_country($this->getCountry());147 }148 }149 150 /**151 * Retrieves user display name152 *153 * @return string154 */155 public function getDisplayName()156 {157 $display_name = parent::getDisplayName();158 if (!is_null($display_name) && trim($display_name))159 {160 return $display_name;161 }162 else163 {164 return parent::getUsername();165 }166 }167 168 /**169 * Retrieves related applications170 *171 * @param Criteria $c172 * @return array173 */174 public function getRelatedApplications(Criteria $c = null)175 {176 if (!$c instanceof Criteria)177 {178 $c = new Criteria;179 }180 $c->addJoin(ApplicationDeveloperPeer::APPLICATION_ID, ApplicationPeer::ID);181 $c->addJoin(ApplicationDeveloperPeer::DEVELOPER_ID, sfGuardUserPeer::ID);182 $c->add(sfGuardUserPeer::ID, $this->getId());183 return ApplicationPeer::doSelect($c);184 }185 186 /**187 * Retrieves related applications and return their names in a string188 *189 * @param string $separator190 * @return string191 */192 public function getRelatedApplicationsString(Criteria $c = null, $separator = ', ')193 {194 if (!$c instanceof Criteria)195 {196 $c = new Criteria;197 }198 $applications = array();199 foreach ($this->getRelatedApplications($c) as $application)200 {201 $applications[] = $application->getName();202 }203 return implode($separator, $applications);204 }205 206 /**207 * Retrieves related companies208 *209 * @param Criteria $c210 * @return array211 */212 public function getRelatedCompanies(Criteria $c = null)213 {214 if (!$c instanceof Criteria)215 {216 $c = new Criteria;217 }218 $c->addJoin(CompanyPersonPeer::COMPANY_ID, CompanyPeer::ID);219 $c->addJoin(CompanyPersonPeer::USER_ID, sfGuardUserPeer::ID);220 $c->add(sfGuardUserPeer::ID, $this->getId());221 return CompanyPeer::doSelect($c);222 }223 224 /**225 77 * Retrieves mail sender address, in the form "Firstname Lastname" <name@isp.tld> 226 78 * … … 240 92 public function getFullAddress() 241 93 { 242 sfLoader::loadHelpers('I18N'); 243 $address = sprintf('%s %s %s %s, %s (%s)', 244 $this->getAddress(), 245 $this->getZip(), 246 $this->getCity(), 247 $this->getState(), 248 format_country($this->getCountry()), 249 $this->getDisplayName()); 250 return SymfoniansToolkit::onelinize($address); 94 return $this->getProfile()->getFullAddress(); 251 95 } 252 96 … … 258 102 public function getLocation() 259 103 { 260 sfLoader::loadHelpers('I18N'); 261 $address = sprintf('%s %s %s %s, %s', 262 $this->getAddress(), 263 $this->getZip(), 264 $this->getCity(), 265 $this->getState(), 266 format_country($this->getCountry())); 267 return SymfoniansToolkit::onelinize($address); 104 return $this->getProfile()->getLocation(); 268 105 } 269 106 … … 276 113 public function getFullAvatarPath($format = 'standard') 277 114 { 278 if (!$this->getAvatarPath()) 279 { 280 return sfConfig::get('app_people_default_avatar'); 281 } 282 return sprintf('/%s/%s/%s/%s', 283 sfConfig::get('sf_upload_dir_name'), 284 sfConfig::get('app_people_upload_dir', 'people'), 285 $format, 286 $this->getAvatarPath()); 115 $this->getProfile()->getFullAvatarPath($format = 'standard'); 287 116 } 288 117 … … 294 123 public function hasAddress() 295 124 { 296 return $this->get Country() && $this->getCity();125 return $this->getProfile()->hasAddress(); 297 126 } 298 127 … … 446 275 } 447 276 448 public function getPlace()449 {450 sfLoader::loadHelpers('I18N');451 $address = sprintf('%s %s %s %s %s',452 $this->getAddress(),453 $this->getZip(),454 $this->getCity(),455 $this->getState(),456 format_country($this->getCountry()));457 return SymfoniansToolkit::onelinize($address);458 }459 277 460 278 /** … … 501 319 public function getSkills() 502 320 { 503 return $this->getTags(); 504 } 505 506 /** 507 * Get user skill tags string 508 * 509 * @return string 510 */ 511 public function getSkillsString($separator = ', ') 512 { 513 return implode($separator, $this->getSkills()); 514 } 321 return $this->getProfile()->getSkills(); 322 } 323 324 public function getLocalization() 325 { 326 327 return $this->getProfile()->getLocalization(); 328 } 329 330 public function getCoordinates() 331 { 332 333 return $this->getProfile()->getCoordinates(); 334 } 335 336 public function getLatitude() 337 { 338 339 return $this->getProfile()->getLatitude(); 340 } 341 342 public function getLongitude() 343 { 344 345 return $this->getProfile()->getLongitude(); 346 } 347 515 348 516 349 public function addGroupByName($name, $con = null) … … 663 496 664 497 // Suppress all skill tags 665 $this-> removeAllTags();498 $this->getProfile()->removeAllTags(); 666 499 $this->save($con); 667 500 … … 672 505 { 673 506 static $profile_fields = array ( 674 PluginsfGuardUserPeer::DISPLAY_NAME,675 PluginsfGuardUserPeer::ADDRESS,676 PluginsfGuardUserPeer::AVATAR_PATH,677 PluginsfGuardUserPeer::BIRTHDATE,678 PluginsfGuardUserPeer::CITY,679 PluginsfGuardUserPeer::ZIP,680 PluginsfGuardUserPeer::STATE,681 PluginsfGuardUserPeer::COUNTRY,682 PluginsfGuardUserPeer::FEED_URL,683 PluginsfGuardUserPeer::HOMEPAGE,684 PluginsfGuardUserPeer::IS_FOR_HIRE,685 PluginsfGuardUserPeer::TRAC_USERNAME,686 PluginsfGuardUserPeer::SYMFONY_AT,687 PluginsfGuardUserPeer::PHP_AT,688 PluginsfGuardUserPeer::PHONE,689 PluginsfGuardUserPeer::IS_ACTIVE,507 UserProfilePeer::DISPLAY_NAME, 508 UserProfilePeer::ADDRESS, 509 UserProfilePeer::AVATAR_PATH, 510 UserProfilePeer::BIRTHDATE, 511 UserProfilePeer::CITY, 512 UserProfilePeer::ZIP, 513 UserProfilePeer::STATE, 514 UserProfilePeer::COUNTRY, 515 UserProfilePeer::FEED_URL, 516 UserProfilePeer::HOMEPAGE, 517 UserProfilePeer::IS_FOR_HIRE, 518 UserProfilePeer::TRAC_USERNAME, 519 UserProfilePeer::SYMFONY_AT, 520 UserProfilePeer::PHP_AT, 521 UserProfilePeer::PHONE, 522 //PluginsfGuardUserPeer::IS_ACTIVE, 690 523 ); 691 524 foreach ($profile_fields as $column) 692 525 { 693 if ($this-> isColumnModified($column))526 if ($this->getProfile()->isColumnModified($column)) 694 527 { 695 528 return true; … … 770 603 } 771 604 772 parent::setKarma($karma_points); 605 $this->getProfile()->setKarma($karma_points); 606 $this->getProfile()->save(); 773 607 sfLogger::getInstance()->info(sprintf('karmadebug: %s\'s karma updated to %d', 774 608 $this->getUsername(), … … 816 650 } 817 651 652 /*** Mapping of profile basic getters ******/ 653 654 /** 655 * Retrieves user display name 656 * 657 * @return string 658 */ 659 public function getDisplayName() 660 { 661 return $this->getProfile()->getDisplayName(); 662 } 663 664 public function getEmail() 665 { 666 667 return $this->getProfile()->getEmail(); 668 } 669 670 public function getAvatarPath() 671 { 672 673 return $this->getProfile()->getAvatarPath(); 674 } 675 676 public function getTracUsername() 677 { 678 679 return $this->getProfile()->getTracUsername(); 680 } 681 682 public function getHomepage() 683 { 684 685 return $this->getProfile()->getHomepage(); 686 } 687 688 public function getFeedUrl() 689 { 690 691 return $this->getProfile()->getFeedUrl(); 692 } 693 694 public function getSummary() 695 { 696 697 return $this->getProfile()->getSummary(); 698 } 699 700 public function getPhpAt() 701 { 702 return $this->getProfile()->getBirthDate(); 703 } 704 705 public function getSymfonyAt() 706 { 707 return $this->getProfile()->getBirthDate(); 708 } 709 710 public function getBirthDate() 711 { 712 return $this->getProfile()->getBirthDate(); 713 } 714 715 public function getAddress() 716 { 717 718 return $this->getProfile()->getAddress(); 719 } 720 721 722 public function getZip() 723 { 724 725 return $this->getProfile()->getZip(); 726 } 727 728 729 public function getCity() 730 { 731 732 return $this->getProfile()->getCity(); 733 } 734 735 736 public function getState() 737 { 738 739 return $this->getProfile()->getState(); 740 } 741 742 743 public function getCountry() 744 { 745 746 return $this->getProfile()->getSummary(); 747 } 748 749 750 public function getPhone() 751 { 752 753 return $this->getProfile()->getPhone(); 754 } 755 756 757 public function getKarma() 758 { 759 760 return $this->getProfile()->getKarma(); 761 } 762 763 764 public function getIsValidated() 765 { 766 767 return $this->getProfile()->getIsValidated(); 768 } 769 770 public function getAllowLocalization() 771 { 772 773 return $this->getProfile()->getAllowLocalization(); 774 } 775 776 777 public function getIsForHire() 778 { 779 780 return $this->getProfile()->getIsForHire(); 781 } 782 818 783 } 819 820 sfPropelBehavior::add('sfGuardUser',821 array('sfPropelActAsLocalizableBehavior' =>822 array('location_getter' => 'getPlace'),823 'sfPropelActAsTaggableBehavior'));824 825 sfLucenePropelBehavior::getInitializer()->setupModel('sfGuardUser');branches/jtexier/lib/model/PluginsfGuardUserPeer.php
r23 r30 94 94 $c = new Criteria(); 95 95 $c->clearSelectColumns(); 96 $c->addSelectColumn(self::COUNTRY); 96 $c->addJoin(self::ID,UserProfilePeer::USER_ID); 97 $c->addSelectColumn(UserProfilePeer::COUNTRY); 97 98 $c->add(self::IS_ACTIVE, true); 98 $c->addGroupByColumn( self::COUNTRY);99 $c->addAscendingOrderByColumn( self::COUNTRY);99 $c->addGroupByColumn(UserProfilePeer::COUNTRY); 100 $c->addAscendingOrderByColumn(UserProfilePeer::COUNTRY); 100 101 $rs = self::doSelectRS($c); 101 102 while ($rs->next()) branches/jtexier/plugins/sfGuardPlugin/lib/model/map/sfGuardUserMapBuilder.php
r2 r30 51 51 $tMap->addColumn('IS_SUPER_ADMIN', 'IsSuperAdmin', 'boolean', CreoleTypes::BOOLEAN, true, null); 52 52 53 $tMap->addColumn('DISPLAY_NAME', 'DisplayName', 'string', CreoleTypes::VARCHAR, false, 255);54 55 $tMap->addColumn('EMAIL', 'Email', 'string', CreoleTypes::VARCHAR, true, 100);56 57 $tMap->addColumn('AVATAR_PATH', 'AvatarPath', 'string', CreoleTypes::VARCHAR, false, 40);58 59 $tMap->addColumn('TRAC_USERNAME', 'TracUsername', 'string', CreoleTypes::VARCHAR, false, 50);60 61 $tMap->addColumn('HOMEPAGE', 'Homepage', 'string', CreoleTypes::VARCHAR, false, 255);62 63 $tMap->addColumn('FEED_URL', 'FeedUrl', 'string', CreoleTypes::VARCHAR, false, 255);64 65 $tMap->addColumn('SUMMARY', 'Summary', 'string', CreoleTypes::LONGVARCHAR, false, null);66 67 $tMap->addColumn('PHP_AT', 'PhpAt', 'int', CreoleTypes::TIMESTAMP, false, null);68 69 $tMap->addColumn('SYMFONY_AT', 'SymfonyAt', 'int', CreoleTypes::TIMESTAMP, false, null);70 71 $tMap->addColumn('BIRTHDATE', 'Birthdate', 'int', CreoleTypes::TIMESTAMP, false, null);72 73 $tMap->addColumn('ADDRESS', 'Address', 'string', CreoleTypes::LONGVARCHAR, false, null);74 75 $tMap->addColumn('ZIP', 'Zip', 'string', CreoleTypes::VARCHAR, false, 10);76 77 $tMap->addColumn('CITY', 'City', 'string', CreoleTypes::VARCHAR, true, 50);78 79 $tMap->addColumn('STATE', 'State', 'string', CreoleTypes::VARCHAR, false, 50);80 81 $tMap->addColumn('COUNTRY', 'Country', 'string', CreoleTypes::VARCHAR, true, 2);82 83 $tMap->addColumn('PHONE', 'Phone', 'string', CreoleTypes::VARCHAR, false, 20);84 85 $tMap->addColumn('KARMA', 'Karma', 'int', CreoleTypes::INTEGER, true, null);86 87 $tMap->addColumn('IS_VALIDATED', 'IsValidated', 'boolean', CreoleTypes::BOOLEAN, false, null);88 89 $tMap->addColumn('ALLOW_CONTACT', 'AllowContact', 'boolean', CreoleTypes::BOOLEAN, false, null);90 91 $tMap->addColumn('ALLOW_LOCALIZATION', 'AllowLocalization', 'boolean', CreoleTypes::BOOLEAN, false, null);92 93 $tMap->addColumn('IS_FOR_HIRE', 'IsForHire', 'boolean', CreoleTypes::BOOLEAN, false, null);94 95 $tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);96 97 53 } 98 54 } branches/jtexier/plugins/sfGuardPlugin/lib/model/om/BasesfGuardUser.php
r2 r30 44 44 protected $is_super_admin = false; 45 45 46 47 48 protected $display_name; 49 50 51 52 protected $email; 53 54 55 56 protected $avatar_path; 57 58 59 60 protected $trac_username; 61 62 63 64 protected $homepage; 65 66 67 68 protected $feed_url; 69 70 71 72 protected $summary; 73 74 75 76 protected $php_at; 77 78 79 80 protected $symfony_at; 81 82 83 84 protected $birthdate; 85 86 87 88 protected $address; 89 90 91 92 protected $zip; 93 94 95 96 protected $city; 97 98 99 100 protected $state; 101 102 103 104 protected $country; 105 106 107 108 protected $phone; 109 110 111 112 protected $karma = 0; 113 114 115 116 protected $is_validated = false; 117 118 119 120 protected $allow_contact = false; 121 122 123 124 protected $allow_localization = false; 125 126 127 128 protected $is_for_hire = false; 129 130 131 132 protected $updated_at; 46 47 protected $collsfGuardUserPermissions; 48 49 50 protected $lastsfGuardUserPermissionCriteria = null; 51 52 53 protected $collsfGuardUserGroups; 54 55 56 protected $lastsfGuardUserGroupCriteria = null; 57 58 59 protected $collsfGuardRememberKeys; 60 61 62 protected $lastsfGuardRememberKeyCriteria = null; 133 63 134 64 … … 193 123 194 124 195 protected $collsfGuardUserPermissions; 196 197 198 protected $lastsfGuardUserPermissionCriteria = null; 199 200 201 protected $collsfGuardUserGroups; 202 203 204 protected $lastsfGuardUserGroupCriteria = null; 205 206 207 protected $collsfGuardRememberKeys; 208 209 210 protected $lastsfGuardRememberKeyCriteria = null; 125 protected $collUserProfiles; 126 127 128 protected $lastUserProfileCriteria = null; 211 129 212 130 … … 310 228 311 229 312 public function getDisplayName()313 {314 315 return $this->display_name;316 }317 318 319 public function getEmail()320 {321 322 return $this->email;323 }324 325 326 public function getAvatarPath()327 {328 329 return $this->avatar_path;330 }331 332 333 public function getTracUsername()334 {335 336 return $this->trac_username;337 }338 339 340 public function getHomepage()341 {342 343 return $this->homepage;344 }345 346 347 public function getFeedUrl()348 {349 350 return $this->feed_url;351 }352 353 354 public function getSummary()355 {356 357 return $this->summary;358 }359 360 361 public function getPhpAt($format = 'Y-m-d H:i:s')362 {363 364 if ($this->php_at === null || $this->php_at === '') {365 return null;366 } elseif (!is_int($this->php_at)) {367 $ts = strtotime($this->php_at);368 if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [php_at] as date/time value: " . var_export($this->php_at, true));369 }370 } else {371 $ts = $this->php_at;372 }373 if ($format === null) {374 return $ts;375 } elseif (strpos($format, '%') !== false) {&nbs
