Witam. Chce zrobić licznik gości online mam takie pytanie

w klasie myUser mam cos takiego

  1. <?php
  2. class myUser extends sfGuardSecurityUser
  3. {
  4.  public function initialize(sfEventDispatcher $dispatcher, sfStorage $storage, $options = array())
  5.  {
  6.    parent::initialize($dispatcher, $storage, $options);
  7.    
  8.    if ($this->isAuthenticated()) {
  9.      
  10.      $con = Propel::getConnection();
  11.  
  12.      $c1 = new Criteria();
  13.      $c1->add(SfGuardUserProfilePeer::ID, 1);  // tu sobie na sztywno wpisalem zeby sprawdzic czy dziala
  14.      
  15.      // update set
  16.      $c2 = new Criteria();
  17.      $c2->add(SfGuardUserProfilePeer::LAST_ACTION, time());
  18.      
  19.      BasePeer::doUpdate($c1, $c2, $con);
  20.    }
  21.    
  22.  }
  23. }
  24. ?>


Jak sprawdzic ID uzytkownika zalogowanego: sprawdzenie autentykacji działa

  1. <?php
  2. $this->isAuthenticated()
  3. ?>


ale jak się dobrać do ID ?

bo w $this tego nie ma
  1. <?php
  2. $this->getUser()->getGuardUser()->getId()
  3. ?>


Ok działa tak:
  1. <?php
  2. $this->getGuardUser()->getId();
  3. ?>