Exemplo n.º 1
0
 /**
  * @param string $attribute
  * @param string $value
  * @return UserVO
  * @throws \Exception
  */
 public function findBy(string $attribute, string $value)
 {
     $params = [$attribute => $value];
     $row = $this->queryBuilder->useDatabase(Config::getDatabaseName())->select()->from(self::TABLE)->where($attribute, '=')->execute($params)->getRow();
     $userVO = new UserVO();
     $userVO->setEmail($row['email']);
     $userVO->setUserName($row['user_name']);
     $userVO->setUserPassword($row['user_password']);
     return $userVO;
 }