I'm sure someone else has run across this, so I'll throw this question out here ... I'm using OrmAuth and need an easy way to query metadata associated with a user based on a username. When I run the migration, there are multiple tables created but the ones I am focused on are "users" and "users_metadata". I'm sure I need to use some kind of JOIN, but I don't have too much experience with SQL joins so any help would be greatly appreciated!
You don't have to do that, ORM will take care of that for you.
The metadata table is accessable as an EAV (entity-attribute-value) container, so if your user has a metdata property 'fullname', you can access it as if it were a property of the user object, like $user->fullname. ORM will fetch it for you in the background.
If you need direct access to all user metadata at once, you can access the $user->metadata relation. It returns an array with a metadata model object for each record, just like any other ORM relation.
And if you need everything at once, you can even do
Actually, the above won't work. I am attempting to manipulate data prior to the user logging in. The entire auth framework relies upon the user actually being logged in but seems to completely ignore any actions that a developer would want to perform pre-login.
For Ormauth, all models are included in the Auth package. If you insist you want your own model, it should extend the Auth one:
class User extend \Model\Auth_User {}
yours extends \Model, which is not an ORM model, and is not going to work anyway. Perhaps you should read up on ORM, to see how it works and what it does.
And obviously the Orm package must be loaded for Ormauth to work...