Error:
Fatal error: Call to undefined method Directory::find() in C:\SERVER_DIR\app\controllers\IndexController.php
IndexController.php
class IndexController extends ControllerBase
{
public function indexAction()
{
$this->view->title = 'Title';
$this->view->directory = Directory::find();
}
}
Directory.php
class Directory extends \Phalcon\Mvc\Model
{
/**
*
* @var integer
*/
public $id;
/**
*
* @var string
*/
public $slug;
/**
*
* @var string
*/
public $title;
/**
* Independent Column Mapping.
*/
public function columnMap()
{
return array(
'id' => 'id',
'slug' => 'slug',
'title' => 'title'
);
}
}
Object category is created. What could be the problem?