Ejemplo n.º 1
0
 public function executeAtom_feed($request)
 {
     $id = $request->getParameter("id");
     $user = UserTable::retrieveByUsername($id);
     $this->forward404Unless($user);
     $this->activities = MongoManager::getDM()->getRepository('Documents\\YiidActivity')->findLatestByUserId($user->getId());
     $this->user = $user;
     $this->setLayout("atom_layout");
 }
Ejemplo n.º 2
0
 /**
  * generates an username, ensuring it's unique by appending a counter
  *
  * @author Christian Weyand
  * @param string $pUsername
  * @return string
  */
 public static function getUniqueUsername($pUsername)
 {
     $lUniqueName = $pUsername;
     $lCounter = 1;
     while ($lUser = UserTable::retrieveByUsername($lUniqueName)) {
         $lUniqueName = $pUsername . $lCounter;
         $lCounter++;
     }
     return $lUniqueName;
 }
 public function generateErrorLog()
 {
     $lUserHugo = UserTable::retrieveByUsername('hugo');
     $lHugoOis = $lUserHugo->getOnlineIdentities();
     $lHugoOi = $lHugoOis[0];
     for ($i = 0; $i <= 100; $i++) {
         $lError = new Documents\ApiErrorLog();
         $lError->setCode($i);
         $lError->setMessage("I Pity the Fool");
         $lError->setOiId($lHugoOi->getId());
         $lError->setUId($lUserHugo->getId());
         $dm = MongoManager::getDM();
         $dm->persist($lError);
         $dm->flush();
     }
 }