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

      // Set the passend language UID.
      $settings = $query->getQuerySettings();
      $settings->setLanguageUid($languageUid);

      // 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 raw object.
      $result = $query->execute(true);

      return $result[0];
    }

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

      // Set the passend language UID.
      $settings = $query->getQuerySettings();
      $settings->setLanguageUid($languageUid);

      // 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 raw object.
      $result = $query->execute(true);

      return $result[0];
    }

    return null;
  }
public function getRawObjectByUid ( int $ uid , int $ languageUid = 0 , array $ querySettings = [ 'respectSysLanguage' => false ] ) { if ( $ uid && $ uid > 0 ) { // Create a new query. $ query = $ this -> createquery ( ) ; // Set the passend language UID. $ settings = $ query -> getQuerySettings ( ) ; $ settings -> setLanguageUid ( $ languageUid ) ; // 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 raw object. $ result = $ query -> execute ( true ) ; return $ result [ 0 ] ; } return null ; }
Gets a raw object by UID.

@param int $uid The UID
@param int $languageUid The language UID, defaults to `0`
@param array $querySettings The optional query settings to apply
@return object|null The raw object or null if no object was found
Gets a raw object by UID .