简体   繁体   中英

Phalcon\Mvc\Model findBy*** static methods

Today i discovered that my model object has methods like findBy{property}. (i am using phalcon 0.9.0)

For example, i have model Language with id, code, name properties. And for each i can call methods like Language::findByCode('en'); or Language::findByName('English');

this is unbelieveable fantastic. can i use this in my project (it is big enough, so i don't want to rewrite the code later)? i mean will those static methods appear in the future?

And is there any docs about those methods? I was unable to find such docs about this :((

This functionality has been introduced in 0.9.0 which is still in Beta stage.

The documents for 0.9.0 can be found here . However since 0.9.0 is not marked as stable yet, there is work to be done for the relevant docs version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM