Пример #1
0
 /**
  * @param DleUsers $objDleUsers The DB ORM object to process
  */
 protected function process_object($objDleUsers)
 {
     // wp: ID,      user_login, user_nicename, user_email, user_registered,           display_name
     // dl: user_id, name,       name,          email,      FROM_UNIXTIME( reg_date ), fullname
     $strEmail = $objDleUsers->Email;
     if ($strEmail && strlen($strEmail)) {
         // check if already copied
         if (!WpUsers::QueryCount(QQ::Equal(QQN::WpUsers()->UserEmail, $strEmail))) {
             $objWpUsers = new WpUsers();
             $objWpUsers->Initialize();
             // set defaults
             $objWpUsers->UserLogin = $objDleUsers->Name;
             $objWpUsers->UserNicename = $objDleUsers->Name;
             $objWpUsers->UserEmail = $objDleUsers->Email;
             $objWpUsers->UserRegistered = QDateTime::FromTimestamp(intval($objDleUsers->RegDate));
             $objWpUsers->DisplayName = $objDleUsers->Fullname;
             $objWpUsers->UserPass = '';
             $objWpUsers->UserUrl = '';
             $objWpUsers->UserActivationKey = '';
             $objWpUsers->UserStatus = 0;
             $objWpUsers->Save();
             $this->intUserCount++;
         }
     }
 }
Пример #2
0
 /**
  * @return WpUsers The Wordpress user for this DLE post author.
  */
 public function LoadWpUser()
 {
     $objDleUsers = DleUsers::LoadByName($this->Autor);
     if (!$objDleUsers) {
         return null;
     }
     return WpUsers::QuerySingle(QQ::Equal(QQN::WpUsers()->UserEmail, $objDleUsers->Email), QQ::Clause(QQ::LimitInfo(1)));
 }
Пример #3
0
 /**
  * @return WpUsers|null The Wordpress user for this DLE comment author.
  */
 public function LoadWpUsers()
 {
     $objDleUsers = $this->User;
     if (!$objDleUsers) {
         return WpUsers::QuerySingle(QQ::Equal(QQN::WpUsers()->UserEmail, $this->Email), QQ::Clause(QQ::LimitInfo(1)));
     }
     return $objDleUsers->LoadWpUsers();
 }
Пример #4
0
 public function LoadFirst()
 {
     return self::QuerySingle(QQ::All(), QQ::Clause(QQ::OrderBy(QQN::WpUsers()->Id), QQ::LimitInfo(1)));
 }
Пример #5
0
 /**
  * Count WpUserses
  * by UserNicename Index(es)
  * @param string $strUserNicename
  * @return int
  */
 public static function CountByUserNicename($strUserNicename)
 {
     // Call WpUsers::QueryCount to perform the CountByUserNicename query
     return WpUsers::QueryCount(QQ::Equal(QQN::WpUsers()->UserNicename, $strUserNicename));
 }
Пример #6
0
 /**
  * @return WpUsers The Wordpress user for this DLE user.
  */
 public function LoadWpUsers()
 {
     return WpUsers::QuerySingle(QQ::Equal(QQN::WpUsers()->UserEmail, $this->Email), QQ::Clause(QQ::LimitInfo(1)));
 }