original_string: public static function findPublishedByIdOrAlias($idOrAlias)
      {
          $values = [];
          $columns = [];
          $t = static::getTableAlias();
  
          // Determine the alias condition
          if (is_numeric($idOrAlias)) {
              $columns[] = "$t.id=?";
              $values[] = (int) $idOrAlias;
          } else {
              if (MultilingualHelper::isActive()) {
                  $columns[] = '(t1.alias=? OR t2.alias=?)';
                  $values[] = $idOrAlias;
                  $values[] = $idOrAlias;
              } else {
                  $columns[] = "$t.alias=?";
                  $values[] = $idOrAlias;
              }
          }
  
          if (!BE_USER_LOGGED_IN) {
              $columns[] = "$t.published=?";
              $values[] = 1;
          }
  
          return static::findOneBy($columns, $values);
      }
code: public static function findPublishedByIdOrAlias($idOrAlias)
      {
          $values = [];
          $columns = [];
          $t = static::getTableAlias();
  
          // Determine the alias condition
          if (is_numeric($idOrAlias)) {
              $columns[] = "$t.id=?";
              $values[] = (int) $idOrAlias;
          } else {
              if (MultilingualHelper::isActive()) {
                  $columns[] = '(t1.alias=? OR t2.alias=?)';
                  $values[] = $idOrAlias;
                  $values[] = $idOrAlias;
              } else {
                  $columns[] = "$t.alias=?";
                  $values[] = $idOrAlias;
              }
          }
  
          if (!BE_USER_LOGGED_IN) {
              $columns[] = "$t.published=?";
              $values[] = 1;
          }
  
          return static::findOneBy($columns, $values);
      }
code_tokens: public static function findPublishedByIdOrAlias ( $ idOrAlias ) { $ values = [ ] ; $ columns = [ ] ; $ t = static :: getTableAlias ( ) ; // Determine the alias condition if ( is_numeric ( $ idOrAlias ) ) { $ columns [ ] = "$t.id=?" ; $ values [ ] = ( int ) $ idOrAlias ; } else { if ( MultilingualHelper :: isActive ( ) ) { $ columns [ ] = '(t1.alias=? OR t2.alias=?)' ; $ values [ ] = $ idOrAlias ; $ values [ ] = $ idOrAlias ; } else { $ columns [ ] = "$t.alias=?" ; $ values [ ] = $ idOrAlias ; } } if ( ! BE_USER_LOGGED_IN ) { $ columns [ ] = "$t.published=?" ; $ values [ ] = 1 ; } return static :: findOneBy ( $ columns , $ values ) ; }
docstring: Find published category by ID or alias.
  
  @param string $idOrAlias
  
  @return NewsCategoryModel|null
docstring_tokens: Find published category by ID or alias .