I'm having a bit of trouble with autoloader configuration for a bundle I'm writing.
I have the following classes:
Ravenly\Models\RavenUser
in models/raven_user.phpRavenly\Ravenly
in ravenly.phpI am trying to do the following:
$exists = call_user_func($class.'::where_crsid', $crsid)->count() > 0;
But I get the following error:
call_user_func() expects parameter 1 to be a valid callback, class 'Ravenly\Models\RavenUser' not found
I have tried setting $class
(which is set in a config file) to "Models\RavenUser"
as well, but I get the same error. I have my autoloader configured as follows:
Autoloader::namespaces(array(
'Ravenly' => Bundle::path('ravenly')
));
I don't understand why it's not working...
The file name must match the class name. Your file should be named ravenuser.php