Пример #1
0
 function testClassUtils()
 {
     $obj = ClassUtils::newClass('test_classutils\\foo', array(1, 2, 3, 4, 5));
     isa_ok('test_classutils\\foo', $obj);
     $this->assertEquals(1, $obj->v1);
     $this->assertEquals(2, $obj->v2);
     $obj = ClassUtils::newClass('test_classutils\\bar');
     isa_ok('test_classutils\\bar', $obj);
 }
Пример #2
0
/**
 * Rewrite this as an extension.
 *
 * {% set obj = new('InputSystem\\Model\\Patient') %}
 * {% set obj = new('InputSystem\\Model\\PatientSchema') %}
 */
function newObject($class)
{
    $args = func_get_args();
    array_shift($args);
    return ClassUtils::new_class($class, $args);
}