We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

PHQL + Vokuro, really confused.

Hi.

Since there isn't much documentation for Vokuro on Github or the docs.phalcon.io so i'll ask here.

I don't understand how Vokuro get it's information from the database, there must be some kind of queries in it.

https://github.com/phalcon/vokuro/blob/master/app/models/Users.php for example has multiple hasMany() functions but that doesn't make sense to me at all.

In the controller, https://github.com/phalcon/vokuro/blob/master/app/controllers/UsersController.php does it for example call this

$user = Users::findFirstById($id);

i guess it does something under the hood, but i don't get it.

help.



8.1k

Read up on models.



21.1k

Read up on models.

That helped a little :) makes more sense, but then.. how about findFirstById() or

$confirmation = EmailConfirmations::findFirstByCode($code);

How do they "ByCode" ?



98.9k

This is called a 'Finder':

$confirmation = EmailConfirmations::findFirstByCode($code);

It's the same as:

$confirmation = EmailConfirmations::findFirst(array("code = ?0", 'bind' => array($code)));

Model EmailConfirmations has a field called 'code'



21.1k

Okay.

So if i have a public variable called $status Can i also do "findFirstByStatus()" ?



98.9k

Not exactly, those must be fields in the mapped table, not attributes of the class.

Okay.

So if i have a public variable called $status Can i also do "findFirstByStatus()" ?