- schedule_id
- user_id
- status_id
- start_time (timestamp)
- end_time (timestamp)
- branch_id
- department_id
How might I reference these from getAll?
Or will a custom query like the one below work?
Code: Select all
$id = $this->getId();
$limit = NULL;
$where = NULL;
$order = NULL;
$page = NULL;
$query = "
select
s.id as schedule_id,
s.user_date_id as user_date_id,
u.user_id as user_id,
s.status_id as status_id,
s.start_time as start_time,
s.end_time as end_time,
s.branch_id as branch_id,
s.department_id as department_id
from
schedule s,
user_date u
WHERE
s.deleted = 0 AND
u.deleted = 0 AND
s.user_date_id = u.id AND
s.id = '$id'";
$query .= $this->getWhereSQL( $where );
$query .= $this->getSortSQL( $order );
$result = $this->ExecuteSQL( $query, NULL, $limit, $page );