public function testHooking() { $testModel = new TestModel(); Hook::hookObject($testModel, 'TestModel->'); $this->assertInstanceOf('\\SciActive\\HookOverride_TestModel', $testModel); return $testModel; }
/** * Create a new instance. * @return \Nymph\Entity The new instance. */ public static function factory() { $class = get_called_class(); $args = func_get_args(); $reflector = new \ReflectionClass($class); $entity = $reflector->newInstanceArgs($args); // Use hook functionality when in 2be. if (class_exists('\\SciActive\\Hook')) { \SciActive\Hook::hookObject($entity, $class . '->', false); } return $entity; }
<?php namespace Nymph; use SciActive\RequirePHP; RequirePHP::_('Nymph', ['NymphConfig'], function ($NymphConfig) { $class = '\\Nymph\\Drivers\\' . $NymphConfig['driver'] . 'Driver'; $Nymph = new $class($NymphConfig); if ($NymphConfig['pubsub']) { \SciActive\Hook::hookObject($Nymph, 'Nymph->'); \Nymph\PubSub\HookMethods::setup(); } return $Nymph; }); /** * Nymph * * An object relational mapper with PHP and JavaScript interfaces. Written by * Hunter Perrin for SciActive. * * @package Nymph * @license http://www.gnu.org/licenses/lgpl.html * @author Hunter Perrin <*****@*****.**> * @copyright SciActive.com * @link http://nymph.io/ */ class Nymph { const VERSION = '1.4.3'; public static function __callStatic($name, $args) {