how function getGenericObject of Factory class works
Posted: Tue Feb 23, 2016 7:14 pm
Hi,
I'm in ScheduleFactory.class.php and I've would like to get 'other_id1' and 'other_id2' column values (aka data) of the Branch object/table, and I saw these codes below, inside the function getScheduleArray:
I wondered how to get the remaining values of the Branch object/table (to be shown as additional columns in the schedule table) with the above code but I did not figure it out.
However, I saw a function inside the same ScheduleFactory class called getBranchObject shown below:
which returns the branch object (probably), so I tried something like this:
but there's no value returned inside $branch_other_id1.
Is my code above correct, or am I missing something?
And also does getGenericObject function of Factory class gets the whole object with all column values attached to it, not just its branch_id?
Thanks
I'm in ScheduleFactory.class.php and I've would like to get 'other_id1' and 'other_id2' column values (aka data) of the Branch object/table, and I saw these codes below, inside the function getScheduleArray:
Code: Select all
'default_branch_id' => (int)$s_obj->getColumn('default_branch_id'),
'default_branch' => $s_obj->getColumn('default_branch'),
...
'job_branch_id' => (int)$s_obj->getColumn('job_branch_id'),
...
'branch_id' => (int)$s_obj->getBranch(),
'branch' => $s_obj->getColumn('branch'),
However, I saw a function inside the same ScheduleFactory class called getBranchObject shown below:
Code: Select all
function getBranchObject() {
return $this->getGenericObject( 'BranchListFactory', $this->getBranch(), 'branch_obj' );
}
Code: Select all
$branch_other_id1 = $s_obj->getBranchObject()->getOtherID1();
Is my code above correct, or am I missing something?
And also does getGenericObject function of Factory class gets the whole object with all column values attached to it, not just its branch_id?
Thanks