(non-PHPdoc)
@see core_kernel_persistence_ClassInterface::createInstance()
979624
public function createInstance( core_kernel_classes_Class $resource, $label = '', $comment = '', $uri = '')
    {
        $returnValue = null;

    	$subject = '';
    	if ($uri == ''){
			$subject = common_Utils::getNewUri();
		}
		else if ( $uri[0]=='#'){ //$uri should start with # and be well formed
				$modelUri = common_ext_NamespaceManager::singleton()->getLocalNamespace()->getUri();
				$subject = rtrim($modelUri, '#') . $uri;
		}
		else{
				$subject = $uri;
		}

		$returnValue = $this->getModel()->getResource($subject);
		if (!$returnValue->hasType($resource)){
			$returnValue->setType($resource);
		}
		else {
			common_Logger::e('already had type '. $resource);
		}

		if (!empty($label)) {
			$returnValue->setLabel($label);
		}
		if (!empty($comment)) {
			$returnValue->setComment($comment);
		}

        return $returnValue;
    }
1240630
final public static function instance() {
        $c = get_called_class();
       
        if( ! isset( self::$instances[$c] ) )
        {
            self::$instances[$c] = new $c;
        }
       
        return self::$instances[$c];
    }
417959
@Override
    protected Map<Serializable, Object> createInstance() throws Exception {
        final Map<Serializable, Object> cache;
        if (this.cacheName != null) {
            cache = this.cacheFactory.getCache(this.cacheName);
        } else {
            cache = this.cacheFactory.getCache();
        }

        return cache;
    }
314246
private function createInstance(string $class, array $data)
    {
        $rule = $this->rules[$class];

        $reflectionClass = new \ReflectionClass($class);
        $object = $reflectionClass->newInstanceWithoutConstructor();
        $reflectionObject = new \ReflectionObject($object);

        foreach ($rule->getMap() as $property => $key) {
            $reflectionProperty = $reflectionObject->getProperty($property);
            $reflectionProperty->setAccessible(true);

            $constructor = $rule->getConstructor($property);

            $reflectionProperty->setValue($object, is_callable($constructor) ? $constructor($data[$key]) : $data[$key]);
        }

        return $object;
    }
721529
public function createInstanceByCode() {
		$name = $this->getFreeAnonymousName();
	
		$this->declaredInstances[$name]["weak"] = false;
		$this->declaredInstances[$name]["comment"] = "";
		$this->declaredInstances[$name]["class"] = null;
		$this->declaredInstances[$name]["external"] = false;
		$this->declaredInstances[$name]["code"] = "";
		$this->setInstanceAnonymousness($name, true);
	
		return $this->getInstanceDescriptor($name);
	}
1228704
public function build(): CopyToRequest
	{
		$instance = new CopyToRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		if ($this->targetNodeId === null) {
			throw new BuilderException('Property [targetNodeId] is required.');
		}
		$instance->targetNodeId = $this->targetNodeId;
		$instance->insertBeforeNodeId = $this->insertBeforeNodeId;
		return $instance;
	}
72720
public function newInstance()
    {
        $class = get_called_class();
        $instance = new $class();
        $instance->setSerializer($this->getSerializer());
        $instance->setItemConverter($this->getItemConverter()->newInstance());
        return $instance;
    }
892287
public static <T> T newInstance(Class<T> clazz) throws MjdbcException {
        try {
            return clazz.newInstance();

        } catch (InstantiationException ex) {
            throw new MjdbcException(
                    "Failed to create instance: " + clazz.getName() + " - " + ex.getMessage());

        } catch (IllegalAccessException ex) {
            throw new MjdbcException(
                    "Failed to create instance: " + clazz.getName() + " - " + ex.getMessage());
        }
    }
831561
public function newInstance($data = [], $isUpdate = false, $where = null)
    {
        return (new static($data))->isUpdate($isUpdate, $where);
    }
378259
public static function getInstance()
    {
        if (is_null(self::$instance)) {
            throw new \RuntimeException('You must first create the singleton instance with createInstance().');
        }
        self::$instance->setGlobalsFromSugar();
        self::$instance->chdirToSugarDir();

        return self::$instance;
    }
812827
public static Object createInstance(String className)
    {
        //get type
        Class<?> type=ReflectionHelper.getType(className);

        //create instance
        Object instance=ReflectionHelper.createInstance(type);
        
        return instance;
    }
942013
protected function _buildInstance($instance, array $parameters = [])
  {
    if(is_scalar($instance) && class_exists($instance))
    {
      return Objects::create($instance, $parameters);
    }
    return $instance;
  }
1212480
final public static function setInstance($instance)
    {
        if ($instance instanceof PDO) {
            $instance = $instance->getAttribute(PDO::ATTR_DRIVER_NAME);
        }
        if (is_string($instance)) {
            if (class_exists('SQL\Writer\\' . $instance)) {
                $class = 'SQL\Writer\\' . $instance ;
                $instance = new $class;
            } else {
                $instance = new self;
            }
        }

        if (!($instance instanceof self)) {
            throw new RuntimeException('$instance must an instanceof SQL\Writer');
        }

        self::$instance = $instance;
    }
111392
public function newInstance(string $class, array $args, BindInterface $bind)
    {
        $compiledClass = $this->compile($class, $bind);
        $instance = (new ReflectionClass($compiledClass))->newInstanceArgs($args);
        $instance->bindings = $bind->getBindings();

        return $instance;
    }
900696
private static function createInstance($classname, array $arguments = array())
    {
        $reflection_obj = new ReflectionClass($classname);
        if ($reflection_obj->getMethod('__construct')->isPublic()) {
            self::$_instances[ $classname ] = call_user_func_array(array($reflection_obj, 'newInstance'), $arguments);
            if (
                method_exists(self::$_instances[ $classname ], 'init') &&
                is_callable(array(self::$_instances[ $classname ], 'init'))
            ) {
                self::$_instances[ $classname ]->init();
            }
        } else {
            self::$_instances[ $classname ] = new $classname;
            if (
                method_exists(self::$_instances[ $classname ], 'init') &&
                is_callable(array(self::$_instances[ $classname ], 'init'))
            ) {
                call_user_func_array(array(self::$_instances[ $classname ], 'init'), $arguments);
            }
        }
    }
771543
public function newInstance($data=null)
    {
        $class = $this->getClassName();
        $conv = $this->newConverterInstance();

        if(is_null($data))
        {
            $data = array();
        }

        if($conv instanceof IListConverter)
        {
            $data = $conv;
        }

        $o = new $class($data);
        if($conv instanceof IBaseConverter)
        {
            $o->setConverter($conv);
        }

        return $o;
    }
201819
public static function singleton()
    {
        $returnValue = null;

        

		if (core_kernel_persistence_smoothsql_Property::$instance == null){
			core_kernel_persistence_smoothsql_Property::$instance = new core_kernel_persistence_smoothsql_Property();
		}
		$returnValue = core_kernel_persistence_smoothsql_Property::$instance;

        

        return $returnValue;
    }