/**
  * Find object by primary key
  * <code>
  * $obj = $c->findPk(array(12, 34), $con);
  * </code>
  * @param     array[$id_session, $id_user] $key Primary key to use for the query
  * @param     PropelPDO $con an optional connection object
  *
  * @return    SessionRelUser|array|mixed the result, formatted by the current formatter
  */
 public function findPk($key, $con = null)
 {
     if (null !== ($obj = SessionRelUserPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1])))) && $this->getFormatter()->isObjectFormatter()) {
         // the object is alredy in the instance pool
         return $obj;
     } else {
         // the object has not been requested yet, or the formatter is not an object formatter
         $criteria = $this->isKeepQuery() ? clone $this : $this;
         $stmt = $criteria->filterByPrimaryKey($key)->getSelectStatement($con);
         return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
     }
 }
 /**
  * Retrieve object using using composite pkey values.
  * @param      int $id_session
  * @param      int $id_user
  * @param      PropelPDO $con
  * @return     SessionRelUser
  */
 public static function retrieveByPK($id_session, $id_user, PropelPDO $con = null)
 {
     $_instancePoolKey = serialize(array((string) $id_session, (string) $id_user));
     if (null !== ($obj = SessionRelUserPeer::getInstanceFromPool($_instancePoolKey))) {
         return $obj;
     }
     if ($con === null) {
         $con = Propel::getConnection(SessionRelUserPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $criteria = new Criteria(SessionRelUserPeer::DATABASE_NAME);
     $criteria->add(SessionRelUserPeer::ID_SESSION, $id_session);
     $criteria->add(SessionRelUserPeer::ID_USER, $id_user);
     $v = SessionRelUserPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }