Adding static method to model

I guess I'm making some newbie mistake here but I can't find whats wrong. I have a model to which I wanted to add static method...

<?php
use Phalcon\Mvc\Model,
Phalcon\Mvc\Model\Message,
Phalcon\Mvc\Model\Validator\InclusionIn,
Phalcon\Mvc\Model\Validator\Uniqueness;

class Venues extends Model {
    public function getSource() {
        return "t_venue";
    }

    public static function geoFind($lat1, $long1, $lat2, $long2) {
        ........
        return $res;
    }
}

Now when I try to call Venues::geoFind method i get message: "Caught exception: The static method "geoFind" doesn't exist on model "Venues". What am I doing wrong?



20.4k

Try to reset the server: aparently, you've it right.



819

Well, restarting server didnt help (i use built-in php server, ubuntu). However i just created same class under new name Venues2 and it worked. Restarted server again, killed all running php processes and its still same. Venues2 works and Venues doesnt. Any ideas?



20.4k

Maybe you didn't get the models folder in the autoloader (don't think so)

BTW, no more ideas.



819

Nah, i have models in autoloader.

Are there any cached files which phalcon could create or something like that?



20.4k

I don't think so. I also have models with static methods, and all of them work perfectly.

But Phalcon has the last word.



819
edited Aug '14

Something is really wrong here. I just removed php files with Venues class definition at all. And i still get same error. Phalcon still "thinks" that class Venues is defined. :/

EDIT: full system reboot also did nothing. I still get this wierd error.



20.4k

Maybe is something related to the built-in. But I didn't work with it yet.