public function findByUid($uid, array $querySettings = ['respectSysLanguage' => false]) {
    if ($uid && $uid > 0) {
      // Create a new query.
      $query = $this->createquery();

      // Apply the passed query settings.
      $query = $this->applyQuerySettings($query, $querySettings);

      // Set the query constraints.
      $query->matching($query->equals('uid', $uid));

      // Execute the query and get the first object.
      $result = $query->execute()->getFirst();

      return $result;
    }

    return null;
  }
public function findByUid($uid, array $querySettings = ['respectSysLanguage' => false]) {
    if ($uid && $uid > 0) {
      // Create a new query.
      $query = $this->createquery();

      // Apply the passed query settings.
      $query = $this->applyQuerySettings($query, $querySettings);

      // Set the query constraints.
      $query->matching($query->equals('uid', $uid));

      // Execute the query and get the first object.
      $result = $query->execute()->getFirst();

      return $result;
    }

    return null;
  }
public function findByUid ( $ uid , array $ querySettings = [ 'respectSysLanguage' => false ] ) { if ( $ uid && $ uid > 0 ) { // Create a new query. $ query = $ this -> createquery ( ) ; // Apply the passed query settings. $ query = $ this -> applyQuerySettings ( $ query , $ querySettings ) ; // Set the query constraints. $ query -> matching ( $ query -> equals ( 'uid' , $ uid ) ) ; // Execute the query and get the first object. $ result = $ query -> execute ( ) -> getFirst ( ) ; return $ result ; } return null ; }
Finds objects by UID, overrides the default one.

@param int $uid The UID
@param array $querySettings The optional query settings to apply
@return object|null The found object or null if no object was found
Finds objects by UID overrides the default one .