You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PlexShare/fuel/packages/orm/classes/observer/self.php

35 lines
696 B

<?php
/**
* Fuel is a fast, lightweight, community driven PHP 5.4+ framework.
*
* @package Fuel
* @version 1.8.1
* @author Fuel Development Team
* @license MIT License
* @copyright 2010 - 2018 Fuel Development Team
* @link http://fuelphp.com
*/
namespace Orm;
/**
* Dummy observer class, which allows you to define observer methods in the
* model itself.
*/
class Observer_Self
{
/**
* Get notified of an event
*
* @param Model $instance
* @param string $event
*/
public static function orm_notify(Model $instance, $event)
{
if (method_exists($instance, $method = '_event_'.$event))
{
call_user_func(array($instance, $method));
}
}
}