http://docs.phalconphp.com/en/latest/reference/models.html#using-a-custom-events-managerで説明されているように、イベントマネージャーの例を使用しようとしています。
class Products extends Phalcon\Mvc\Model
{
public function initialize()
{
$eventsManager = new Phalcon\Events\Manager();
$eventsManager->attach('model', function($event, $robot) {
// Do something (or nothing at all).
return true;
});
$this->setEventsManager($eventsManager);
$this->setSource('products');
}
}
$o = Products::findFirst();
$o->we = 5;
$o->save();
これにより、次のエラーが発生します。
スクリプトは「Phalcon\Mvc\Model\Manager::notifyEvent(): Call to method fire() on a non-object」というメッセージで E_ERROR を発生させました
EventsManager のセットアップで不足しているものは何ですか?
私は Phalcon 1.3.0 を使用しています。
ありがとう、てむり