<?php
class Index extends \Phalcon\Mvc\Model {
public function initialize() {
$this->setSource('hash');
}
public function getSource() {
return 'hash';
}
public function getmd5($s){
$md5 = md5($s);
$this->modelsManager->executeQuery('INSERT INTO index (text,md5) VALUES('.$s.','.$md5.') ');
}
}
class IndexController extends ControllerBase {
public function indexAction() {
for($s = 1; $s < 100; ++$s){
Index::getmd5($s);
}
$query = $this->modelsManager->createQuery('SELECT * FROM index');
$cars = $query->execute();
$this->view->setVar('ss', $cars);
}
}
?>