original_string: public static function getItems($filter = []): array
      {
          $res = [];
  
          /* @var $class LightModel */
          $className = get_called_class();
          $class = new $className;
  
          $sql = 'SELECT * FROM ' . $class->getTableName() . ' WHERE 1=1';
          $params = self::handleFilter($sql, $filter, $class);
  
          $query = DB::getConnection()->prepare($sql);
          $query->execute($params);
  
          foreach ($query->fetchAll(PDO::FETCH_CLASS, $className) as $item)
          {
              $res[] = self::typeCastModel($item);
          }
  
          return $res;
      }
code: public static function getItems($filter = []): array
      {
          $res = [];
  
          /* @var $class LightModel */
          $className = get_called_class();
          $class = new $className;
  
          $sql = 'SELECT * FROM ' . $class->getTableName() . ' WHERE 1=1';
          $params = self::handleFilter($sql, $filter, $class);
  
          $query = DB::getConnection()->prepare($sql);
          $query->execute($params);
  
          foreach ($query->fetchAll(PDO::FETCH_CLASS, $className) as $item)
          {
              $res[] = self::typeCastModel($item);
          }
  
          return $res;
      }
code_tokens: public static function getItems ( $ filter = [ ] ) : array { $ res = [ ] ; /* @var $class LightModel */ $ className = get_called_class ( ) ; $ class = new $ className ; $ sql = 'SELECT * FROM ' . $ class -> getTableName ( ) . ' WHERE 1=1' ; $ params = self :: handleFilter ( $ sql , $ filter , $ class ) ; $ query = DB :: getConnection ( ) -> prepare ( $ sql ) ; $ query -> execute ( $ params ) ; foreach ( $ query -> fetchAll ( PDO :: FETCH_CLASS , $ className ) as $ item ) { $ res [ ] = self :: typeCastModel ( $ item ) ; } return $ res ; }
docstring: Get all items based on filter
  
  @param array $filter
  @return array
docstring_tokens: Get all items based on filter