/**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildUser A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT user_id, rcs_id, first_name, last_name, email, permission_level FROM user WHERE user_id = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildUser $obj */
         $obj = new ChildUser();
         $obj->hydrate($row);
         UserTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
Exemple #2
0
 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildUser A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT id, first_name, last_name, user_name, email, password, uuid, role, created_at, updated_at FROM user WHERE id = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildUser $obj */
         $obj = new ChildUser();
         $obj->hydrate($row);
         UserTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
Exemple #3
0
 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildUser A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT User_ID, First_Name, Last_Name, Email, Password, Address1, Address2, Zipcode, Phone_no FROM User WHERE User_ID = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildUser $obj */
         $obj = new ChildUser();
         $obj->hydrate($row);
         UserTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
Exemple #4
0
 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildUser A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT id, username, password, reddit_id, trusted, admin, moderator, probation, banned FROM user WHERE id = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildUser $obj */
         $obj = new ChildUser();
         $obj->hydrate($row);
         UserTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
Exemple #5
0
 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildUser A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT user_id, user_name, user_password_hash, user_email, user_active, user_deleted, user_account_type, user_has_avatar, user_remember_me_token, user_creation_timestamp, user_suspension_timestamp, user_last_login_timestamp, user_failed_logins, user_last_failed_login, user_activation_hash, user_password_reset_hash, user_password_reset_timestamp, user_provider_type FROM user WHERE user_id = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildUser $obj */
         $obj = new ChildUser();
         $obj->hydrate($row);
         UserTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
Exemple #6
0
 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @return   ChildUser A model object, or null if the key is not found
  */
 protected function findPkSimple($key, $con)
 {
     $sql = 'SELECT ID, UUID, EMAIL, PASSWORD, FIRST_NAME, LAST_NAME, CREATED_AT, UPDATED_AT FROM user WHERE ID = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         $obj = new ChildUser();
         $obj->hydrate($row);
         UserTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }