Hi i am new for phalcon and i really like it so far and i am trying to learn it step by step, but i get an error i can't figure out. i'm try to run a simple select query on my table but i am getting this error
Phalcon\Mvc\Model\Exception: Model 'pictures' could not be loaded
File=/vagrant/app/models/Gallery.php
Line=31
#0 [internal function]: Phalcon\Mvc\Model\Manager->load('pictures') #1 [internal function]: Phalcon\Mvc\Model\Query->_prepareSelect() #2 [internal function]: Phalcon\Mvc\Model\Query->parse() #3 /vagrant/app/models/Gallery.php(31): Phalcon\Mvc\Model\Query->execute() #4 /vagrant/app/controllers/GalleryController.php(27): Gallery->get_pictures(Array) #5 /vagrant/app/controllers/GalleryController.php(9): galleryController->id() #6 [internal function]: galleryController->indexAction() #7 [internal function]: Phalcon\Dispatcher->dispatch() #8 /vagrant/public/index.php(68): Phalcon\Mvc\Application->handle() #9 {main}
my model is.
<?php
use Phalcon\Mvc\Model,
Phalcon\Mvc\Model\Query;
class Gallery extends Phalcon\Mvc\Model
{
public function getSource()
{
return 'pictures';
}
public function get_pictures($options = array())
{
$sql = "SELECT p.id, p.filename ";
$sql .= "FROM pictures p WHERE ";
$sql .= "p.status = 'active' ";
$query = new Phalcon\Mvc\Model\Query($sql, $this->getDI());
return $query->execute();
}
}
Before the code above have i tried with alias as seen at the top. Any idea why it does this?