Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2212

Extension Writers Discussion • Passing data array to custom function in miration

$
0
0
I don't want to flood the standard config table with my vars, so I created a new config table. Sample code in my migration file

Code:

public function update_data(){return [$data = ['var_1'=> 1,'var_2'=> 1,'var_3'=> 0,];// Call a custom callable function to perform more complex operations.['custom', [[$this, 'callable_install']]],];}public function callable_install($data){// Run some SQL queries on the database}
How do I pass the $data array in update_data()? I know I could probably do $this->callable_install($data), but I'm not sure if ['custom', [[$this, 'callable_install']]], allows passing vars.

Statistics: Posted by Kailey — Fri Apr 11, 2025 1:06 pm



Viewing all articles
Browse latest Browse all 2212

Trending Articles