Changeset 30

Show
Ignore:
Timestamp:
03/30/08 22:39:38
Author:
jtexier
Message:

created user_profile table + moved profile methods from PluginsfGuarduser? to UserProfile?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/jtexier/apps/main/modules/people/actions/actions.class.php

    r2 r30  
    8383  { 
    8484    $this->user = $this->getFromSlug('username'); 
     85    $this->getLogger('details_user ' . $this->user->getUsername() ); 
    8586    $this->is_current_user = $this->getUser()->getId() == $this->user->getId(); 
    8687    $this->has_recommended = $this->user->hasBeenRecommendedBy($this->getUser()->getId()); 
  • branches/jtexier/apps/main/modules/sfGuardAuth/actions/actions.class.php

    r2 r30  
    151151      { 
    152152        $profile['avatar_path'] = $thumb; 
    153       } 
    154       $this->user->fromArray($profile, BasePeer::TYPE_FIELDNAME); 
    155       $localization = $this->user->getLocalization(); 
     153      }$this->logMessage('ok'); 
     154      $this->user->getProfile()->fromArray($profile, BasePeer::TYPE_FIELDNAME); 
     155      $localization = $this->user->getProfile()->getLocalization(); 
    156156      if ($profile['latitude'] && $profile['longitude']) 
    157157      { 
     
    164164      else 
    165165      { 
    166         $this->user->updateLocalization(); 
    167       } 
    168       $this->user->save(); 
     166        $this->user->getProfile()->updateLocalization(); 
     167      } 
     168      $this->user->getProfile()->save(); 
    169169      $this->purgePersonRelatedCache($this->user); 
    170170      $this->setFlash('notice', $this->__('Your profile has been updated')); 
  • branches/jtexier/config/schema.yml

    r2 r30  
    146146    _indexes: 
    147147      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  
    8686      description:          summary 
    8787      validator:            getIsActive 
    88     sfGuardUser: 
     88    #sfGuardUser: 
     89    UserProfile: 
    8990      fields: 
    90         username:           text 
     91        #username:           text 
    9192        displayName: 
    9293          boost:            1.5 
  • branches/jtexier/config/sfGuardPlugin_schema.custom.yml

    r2 r30  
    11propel: 
    22 
    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:            longvarchar 
    12     php_at:             timestamp 
    13     symfony_at:         timestamp 
    14     birthdate:          timestamp 
    15     address:            longvarchar 
    16     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  
    22  fabpot: 
    33    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 
     27UserProfile: 
     28  fabpot: 
     29    user_id: fabpot 
    430    display_name:       Fabien Potencier 
    531    summary:            Father of the Symfony framework 
    6     password:           password 
    732    email:              fabien@symfony-project.com 
    833    trac_username:      fabien 
     
    1439    is_for_hire:        0 
    1540    avatar_path:        samples/fabpot.png 
    16     created_at:         "2005-01-01 00:00:00" 
    1741  niko: 
    18     username:           niko 
     42    user_id: niko   
    1943    display_name:       Nicolas Perriault 
    20     password:           password 
    2144    email:              nperriault@gmail.com 
    2245    trac_username:      nicolas 
     
    3760    is_for_hire:        1 
    3861    avatar_path:        samples/niko.jpg 
    39     created_at:         "2004-01-01 00:00:00" 
    4062  mbertier: 
    41     username:           mbertier 
     63    user_id: mbertier   
    4264    display_name:       Tristan Rivoallan 
    43     password:           password 
    4465    email:              tristan@rivoallan.net 
    4566    trac_username:      trivoallan 
     
    5071    is_for_hire:        0 
    5172    avatar_path:        samples/mbertier.png 
    52     created_at:         "2006-01-01 00:00:00" 
    5373  francois: 
    54     username:           francois 
     74    user_id: francois   
    5575    display_name:       François Zaninotto 
    56     password:           password 
    5776    email:              fzaninotto@ma-generation.com 
    5877    trac_username:      francois 
     
    6382    allow_localization: 0 
    6483    is_for_hire:        0 
    65     created_at:         "2007-02-01 00:00:00" 
    6684  johndoe: 
    67     username:           johndoe 
    68     password:           password 
     85    user_id: johndoe   
    6986    email:              john@doe.com 
    7087    summary:            "Super newbie" 
     
    7491    allow_localization: 0 
    7592    is_for_hire:        1 
    76     created_at:         "2007-07-01 00:00:00" 
    7793  unvalidated_person: 
    78     username:           I_shouldnt_appear 
    79     password:           password 
     94    user_id: unvalidated_person 
    8095    email:              foo@bar.com 
    8196    country:            UK 
    8297    is_validated:       0 
    83     is_active:          0 
    84     created_at:         "2007-12-01 00:00:00" 
     98 
    8599 
    86100BlogPost: 
  • branches/jtexier/lib/model/Job.php

    r2 r30  
    8787    $new = $this->isNew(); 
    8888    $modified = $this->isModified(); 
     89 
    8990    $affectedRows = parent::save($con); 
    90      
    9191    if ($affectedRows > 0 && $this->getsfGuardUser()) 
    9292    { 
     
    106106    { 
    107107      $event = new Event(); 
     108       
    108109      if ($this->getCompanyId()) 
    109110      { 
     
    118119        $event->setSourceName($this->getsfGuardUser()->getDisplayName()); 
    119120      } 
     121       
    120122      $event->setTargetModel('Job'); 
    121123      $event->setTargetSlug($this->getSlug()); 
     
    129131        $event->setType('update'); 
    130132      } 
     133 
    131134      $event->save(); 
    132135    } 
  • branches/jtexier/lib/model/PluginsfGuardUser.php

    r23 r30  
    2222  public function __toString() 
    2323  { 
    24     return $this->getDisplayName(); 
     24    return $this->getProfile()->getDisplayName(); 
    2525  } 
    2626 
     
    3232  public function addSkill($skills) 
    3333  { 
    34     return $this->addTag($skills); 
     34    return $this->getProfile()->addTag($skills); 
    3535  } 
    3636 
     
    4242  public function getAge() 
    4343  { 
    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(); 
    5355  } 
    5456   
     
    6264  public function getAllowContact($check_jobs = false) 
    6365  { 
    64     $allow = parent::getAllowContact(); 
     66    $allow = $this->getProfile()->getAllowContact(); 
    6567     
    6668    if ($check_jobs && $this->countJobs(new Criteria) > 0) 
     
    7375 
    7476  /** 
    75    * Retrieves companies associated with current user 
    76    * 
    77    * @param  string  $type  Filter type (submitted, related, all) 
    78    * @return array 
    79    */ 
    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 select 
    105    * html tag 
    106    * 
    107    * @param  string  $type  Filter type (submitted, related, all) 
    108    * @return array 
    109    */ 
    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 string 
    122    * 
    123    * @param  string  $separator 
    124    * @return string 
    125    */ 
    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 name 
    138    * 
    139    * @return string 
    140    */ 
    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 name 
    152    * 
    153    * @return string 
    154    */ 
    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     else 
    163     { 
    164       return parent::getUsername(); 
    165     } 
    166   } 
    167  
    168   /** 
    169    * Retrieves related applications 
    170    * 
    171    * @param  Criteria  $c 
    172    * @return array 
    173    */ 
    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 string 
    188    * 
    189    * @param  string  $separator 
    190    * @return string 
    191    */ 
    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 companies 
    208    * 
    209    * @param  Criteria  $c 
    210    * @return array 
    211    */ 
    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   /** 
    22577   * Retrieves mail sender address, in the form "Firstname Lastname" <name@isp.tld> 
    22678   * 
     
    24092  public function getFullAddress() 
    24193  { 
    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(); 
    25195  } 
    25296 
     
    258102  public function getLocation() 
    259103  { 
    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(); 
    268105  } 
    269106 
     
    276113  public function getFullAvatarPath($format = 'standard') 
    277114  { 
    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'); 
    287116  } 
    288117 
     
    294123  public function hasAddress() 
    295124  { 
    296     return $this->getCountry() && $this->getCity(); 
     125    return $this->getProfile()->hasAddress(); 
    297126  } 
    298127 
     
    446275  } 
    447276 
    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   } 
    459277 
    460278  /** 
     
    501319  public function getSkills() 
    502320  { 
    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   
    515348 
    516349  public function addGroupByName($name, $con = null) 
     
    663496 
    664497    // Suppress all skill tags 
    665     $this->removeAllTags(); 
     498    $this->getProfile()->removeAllTags(); 
    666499    $this->save($con); 
    667500 
     
    672505  { 
    673506    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, 
    690523    ); 
    691524    foreach ($profile_fields as $column) 
    692525    { 
    693       if ($this->isColumnModified($column)) 
     526      if ($this->getProfile()->isColumnModified($column)) 
    694527      { 
    695528        return true; 
     
    770603    } 
    771604 
    772     parent::setKarma($karma_points); 
     605    $this->getProfile()->setKarma($karma_points); 
     606    $this->getProfile()->save(); 
    773607    sfLogger::getInstance()->info(sprintf('karmadebug: %s\'s karma updated to %d', 
    774608                                          $this->getUsername(), 
     
    816650  } 
    817651 
     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   
    818783} 
    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  
    9494      $c = new Criteria(); 
    9595      $c->clearSelectColumns(); 
    96       $c->addSelectColumn(self::COUNTRY); 
     96      $c->addJoin(self::ID,UserProfilePeer::USER_ID);       
     97      $c->addSelectColumn(UserProfilePeer::COUNTRY); 
    9798      $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); 
    100101      $rs = self::doSelectRS($c); 
    101102      while ($rs->next()) 
  • branches/jtexier/plugins/sfGuardPlugin/lib/model/map/sfGuardUserMapBuilder.php

    r2 r30  
    5151                $tMap->addColumn('IS_SUPER_ADMIN', 'IsSuperAdmin', 'boolean', CreoleTypes::BOOLEAN, true, null); 
    5252 
    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  
    9753        }  
    9854}  
  • branches/jtexier/plugins/sfGuardPlugin/lib/model/om/BasesfGuardUser.php

    r2 r30  
    4444        protected $is_super_admin = false; 
    4545 
    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; 
    13363 
    13464         
     
    193123 
    194124         
    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; 
    211129 
    212130         
     
    310228 
    311229         
    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