getStaffJobTitle ( $id )

Source file: app/functions/staff-function.php

View source


Used by


Source

function getStaffJobTitle($id)
{
    $app = \Liten\Liten::getInstance();
    try {
        $title = $app->db->job()
            ->select('job.title')
            ->_join('staff_meta', 'job.ID = staff_meta.jobID')
            ->where('staff_meta.staffID = ?', $id)->_and_()
            ->where('staff_meta.hireDate = (SELECT MAX(hireDate) FROM staff_meta WHERE staffID = ?)', $id)
            ->findOne();

        return _h($title->title);
    } catch (NotFoundException $e) {
        Cascade::getLogger('error')->error($e->getMessage());
        _etsis_flash()->error(_etsis_flash()->notice(409));
    } catch (ORMException $e) {
        Cascade::getLogger('error')->error($e->getMessage());
        _etsis_flash()->error(_etsis_flash()->notice(409));
    } catch (Exception $e) {
        Cascade::getLogger('error')->error($e->getMessage());
        _etsis_flash()->error(_etsis_flash()->notice(409));
    }
}


User Contributed Notes

You must log in before being able to contribute a note.