<?php
namespace  WpBookingProBlock\block_top_employee;
use WpBookingPro\Factory as FactoryAlias;
use WpBookingPro\Utilities\Utility as UtilityAlias;

class block_top_employee_helper{
    public static function getList_employee(){
        $db= FactoryAlias::getDBO();
        $query=$db->getQuery(true);
        $query->select('employee.*')
            ->from(UtilityAlias::getTableName('employee').' AS employee ')
            ->where('employee.published=1')
            ->leftJoin(UtilityAlias::getTableName('location'). ' AS location ON location.id=employee.location_id')
            ->select('location.name as location_name')
        ;
        $list=$db->setQuery($query)->loadObjectList();
       return $list;
    }
}