just tried, forward_static_call() same problem
also,
statically putting in 'disabled=0' in place of the $attr[$key]['source_condition'] produces a column not found error...
<b>Fatal error</b>: Uncaught exception 'ActiveRecord\DatabaseException' with message '42S22, 1054, Unknown column 'disabled' in 'where clause'' in libraries/activerecord/lib/Connection.php:312
Stack trace:
#0 libraries/activerecord/lib/Table.php(218): ActiveRecord\Connection->query('SELECT * FROM `...', Array)
#1 libraries/activerecord/lib/Table.php(209): ActiveRecord\Table->find_by_sql('SELECT * FROM `...', Array, false, NULL)
#2 libraries/activerecord/lib/Model.php(1560): ActiveRecord\Table->find(Array)
#3 [internal function]: ActiveRecord\Model::find('all', Array)
#4 libraries/activerecord/lib/Model.php(1388): call_user_func_array('static::find', Array)
#5 [internal function]: ActiveRecord\Model::all(Array)
#6 app/models/Test.php(79): forward_static in <b>libraries/activerecord/lib/Connection.php</b> on line <b>312</b><br />
Hey LuckyBugger¹!
I just wanted to show you how to make your life easier:
1 $attrkey = $attr[$key];
2
3 $class = 'app\\models\\'.$attrkey['source'];
4 $its = $class::all(array('conditions' => $attrkey['source_condition']));
By the way, I've got some branches that play more nicely with lithium :
Hey Yoan,
I do remember trying the method you posted above, however i was getting a php error about escaped strings...
(1-6/6)
Subject: ignore xD
[code]
$a = array('conditions' => $attr[$key]['source_condition']);
$its = call_user_func(array("app\\models\\".$attr[$key]['source'], 'find'), 'all', $a);
[/code]
$attr[$key]['soruce_condition'] = 'disabled=0';
$attr[$key]['soruce'] = Source;
Code correctly calls the find method, however does not pass the arguments.
All records are returned instead of the ones with disabled=0.
I have tried call_user_func_array() same problem.
Turns out that somewhere in my code the array was being over-wrote and source condition was being set to null.
The stack trace comes from a different object not having the disabled column.
Everything works as intended :D