public function getRelatedCompanies()
    {
        $conn = $this->app->getApplicationBox()->get_connection();

        $sql = 'SELECT DISTINCT Users.company ' . $this->generate_sql_constraints() . ' ORDER BY Users.company';

        $stmt = $conn->prepare($sql);
        $stmt->execute($this->sql_params);
        $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
        $stmt->closeCursor();

        $companies = [];
        foreach ($rs as $row) {
            if (trim($row['company']) === '') {
                continue;
            }
            $companies[] = $row['company'];
        }

        return $companies;
    }
public function getRelatedCompanies()
    {
        $conn = $this->app->getApplicationBox()->get_connection();

        $sql = 'SELECT DISTINCT Users.company ' . $this->generate_sql_constraints() . ' ORDER BY Users.company';

        $stmt = $conn->prepare($sql);
        $stmt->execute($this->sql_params);
        $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
        $stmt->closeCursor();

        $companies = [];
        foreach ($rs as $row) {
            if (trim($row['company']) === '') {
                continue;
            }
            $companies[] = $row['company'];
        }

        return $companies;
    }
public function getRelatedCompanies ( ) { $ conn = $ this -> app -> getApplicationBox ( ) -> get_connection ( ) ; $ sql = 'SELECT DISTINCT Users.company ' . $ this -> generate_sql_constraints ( ) . ' ORDER BY Users.company' ; $ stmt = $ conn -> prepare ( $ sql ) ; $ stmt -> execute ( $ this -> sql_params ) ; $ rs = $ stmt -> fetchAll ( PDO :: FETCH_ASSOC ) ; $ stmt -> closeCursor ( ) ; $ companies = [ ] ; foreach ( $ rs as $ row ) { if ( trim ( $ row [ 'company' ] ) === '' ) { continue ; } $ companies [ ] = $ row [ 'company' ] ; } return $ companies ; }
Get users companies

@return array
Get users companies