Delicious      Technorati      Blinklist      Furl      Reddit

TimeTrex Time and Attendance

TimeTrex Time and Attendance


* FAQ    * Search
* Login   * Register

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Feb 23, 2016 7:14 pm 
Offline

Joined: Sun Feb 14, 2016 6:09 pm
Posts: 51
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:
Code:
'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'),

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:

Code:
function getBranchObject() {
   return $this->getGenericObject( 'BranchListFactory', $this->getBranch(), 'branch_obj' );
}

which returns the branch object (probably), so I tried something like this:
Code:
$branch_other_id1 = $s_obj->getBranchObject()->getOtherID1();

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


Top
 Profile  
 
PostPosted: Sun Feb 28, 2016 6:53 pm 
Offline

Joined: Sun Feb 14, 2016 6:09 pm
Posts: 51
Hi, I have found the solution, the code i showed before actually works, it's just the data having no object that's why there's no value for the getOtherID function. I now have it like below:
Code:
($s_obj->getBranchObject() !== false) ? $s_obj->getBranchObject()->getOtherID1() : ''


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Time and Attendance




Powered by phpBB® Forum Software © phpBB Group