@static
@param string $class
@param bool $delete

@return mixed
769194
static function getSession($class, $delete = false)
	{
		$return = null;
		if (isset($_SESSION['Api'])) {
			if (isset($_SESSION['Api'][$class])) {
				$return = $_SESSION['Api'][$class];
				if ($delete) {
					unset($_SESSION['Api'][$class]);
				}
			}
		}
		return $return;
	}
1334136
public function deserialize($class, $data)
    {
        $document = $this->documentRepo->findOneBy(['uuid' => $data['id']]);

        if (empty($document)) {
            $document = new Document();
            $document->setUuid($data['id']);

            /** @var Drop $drop */
            $drop = $this->dropRepo->findOneBy(['uuid' => $data['drop']]);
            $document->setDrop($drop);
            $currentUser = $this->tokenStorage->getToken()->getUser();

            if ($currentUser instanceof User) {
                $document->setUser($currentUser);
            }
            $document->setDropDate(new \DateTime());
        }
        if (isset($data['type'])) {
            $document->setType($data['type']);

            if (isset($data['data'])) {
                $documentData = Document::DOCUMENT_TYPE_RESOURCE === $document->getType() ?
                    $this->resourceNodeRepo->findOneBy(['uuid' => $data['data']]) :
                    $data['data'];
                $document->setData($documentData);
            }
        }

        return $document;
    }
1086612
protected function getObjectRequestedById(string $class) {
	
		// reads from url requested item id
		$itemId = Router::get(0);
		
		if (!$itemId) {
			$this->enqueueError($this->lang('NO_ID_OF_ITEM_TO_EDIT', $class));
			return NULL;
		}
		
		$object = new $class($itemId);
	
		if ($object->isLoaded()) {
				
			return $object;
	
		} else {
	
			$this->enqueueError($this->lang('ID_OF_ITEM_TO_EDIT_IS_NOT_VALID', $class));
			$this->logError('Object ' . $class . ' id=' . $itemId . ' has not been loaded');
			return NULL;
	
		}
	
	}
599341
public static function deleteOne(string $className, array $condition)
    {
        $instance = self::getInstance($className);

        return Query::table($className)->selectInstance($instance)->condition($condition)->limit(1)->delete();
    }
822924
protected function resolve( $class )
	{
		$instance = UniversalBuilder::resolveClass( $class );

		if ( isset( $this->command ) )
			$instance->setCommand( $this->command );

		return $instance;
	}
706263
protected static function _initialize($class) {
		$self = parent::_initialize($class);
		if (!$self->_inited) {
			$self->_inited = true;
			$self->_init();
		}
		return $self;
	}
1124606
public static function getInstance($static = true)
    {
        if ($static) {
            $calledClass = get_called_class();
            if (!isset(static::$_instances[$calledClass])) {
                static::$_instances[$calledClass] = Yii::createObject(['class' => get_called_class()]);
            }

            return static::$_instances[$calledClass];
        } else {
            return Yii::createObject(['class' => get_called_class()]);
        }
    }
141023
public function getNewInstance($class) {
		if (isset($this->aliases[$class])) {
			$class = $this->aliases[$class];
		}

		$args = $this->resolveArgs($class, '__construct', " when constructing $class");
		if ($args) {
			$instance = new $class(...$args);
		} else {
			$instance = new $class;
		}

		return $instance;
	}
697220
public function delete($deleteReference = false)
    {
        $returnValue = (bool) false;
        $returnValue = $this->getImplementation()->delete($this, $deleteReference);
        return (bool) $returnValue;
    }
579522
private function getFromCache(string $class): ?ClassMetadataInterface
    {
        if (null === $this->cache) {
            return null;
        }

        if ($this->cache instanceof Cache) {
            $cached = $this->cache->fetch($class) ?: null;
        } else {
            $class = preg_replace('#[\{\}\(\)/\\\\@:]#', '_', str_replace('_', '__', $class));
            $item = $this->cache->getItem($class);
            $cached = $item->isHit() ? $item->get() : null;
        }

        return $cached;
    }
636246
public function getTraits(string $class){
        if(!class_exists($class)){
            throw new \InvalidArgumentException();
        }

        if(!array_key_exists($class, $this->traits)){
            $traits     = array_map(
                function($v){
                    return false;
                },
                array_flip(class_uses($class))
            );

            do{
                $continue   = false;
                $new        = [];

                foreach($traits as $trait => $flag){
                    if($flag === false){
                        $traits[$trait] = true;

                        foreach(class_uses($trait) as $use){
                            if(!array_key_exists($use, $traits)){
                                $continue   = true;
                                $new[$use]  = false;
                            }
                        }
                    }
                }

                $traits += $new;
            }while($continue === true);

            $this->traits[$class]   = array_keys($traits);
        }

        return $this->traits[$class];
    }
1052
public function call($class)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string');

        $args = func_get_args();
        $class = array_shift($args);

        return $this->callArray($class, $args);
    }
580606
public function getExtendedClass($class)
    {
        $ret = null;
        if (array_key_exists($class, $this->dynamicClasses)) {
            $ret = $this->dynamicClasses[$class];
        }
        if (!$ret) {
            $ret = array_search($class, $this->classes);
        }
        return $ret?$ret:null;
    }
956583
public function loadClass( $class ) {

		//make sure the class name is absolute
		if ( 0 !== strpos( $class, '\\' ) )
			$class = '\\' . $class;

		// check if the namespace matches the class
		if ( 0 !== strpos( $class, $this->base_ns ) )
			return FALSE;

		// strip the base namespace from the beginning of the class name
		if ( $this->base_ns === substr( $class, 0, strlen( $this->base_ns ) ) )
			$class = substr( $class, strlen( $this->base_ns ) );

		$class = ltrim( $class, '\\' );
		$class = str_replace( '\\', '/', $class );
		$file = $this->base_dir . '/' . $class . '.php';

		return $this->file_loader->loadFile( $file );
	}
606194
public static function load($class)
    {
        $class = static::normalizeClass($class);

        foreach (static::$directories as $directory)
        {
            if (file_exists($path = $directory.DIRECTORY_SEPARATOR.$class))
            {
                require_once $path;

                return true;
            }
        }
        return false;
    }
1368234
public static function load($class)
    {
        /* Protects us from possible remote code inclusion due to:
           https://bugs.php.net/bug.php?id=55475
           We should already be safe without this check due to the
           way this autoloader works, but this helps other autoloaders
           that use other mechanisms and may be vulnerable. */
        if (strpos($class, ":") !== false) {
            // Safer than returning false as it prevents
            // other autoloaders from ever executing...
            throw new \Exception('Possible remote code injection detected');
        }

        // need to check if there's a current map file specified ALSO.
        // this could be the first time writing it.
        $mapped = self::isMapped($class);
        if ($mapped) {
            require_once self::$map[$class];
            if (!self::loadSuccessful($class)) {
                // record this failure & keep going, we may still find it
                self::$unmapped[] = $class;
            } else {
                return true;
            }
        }

        $file = str_replace(
            array('_', '\\'),
            DIRECTORY_SEPARATOR,
            $class
        ) . '.php';
        foreach (self::$paths as $path) {
            if (file_exists($path . DIRECTORY_SEPARATOR . $file)) {
                require_once $path . DIRECTORY_SEPARATOR . $file;
                if (!self::loadSuccessful($class)) {
                    throw new \Exception(
                        'Class ' . $class . ' was not present in ' .
                        $path . DIRECTORY_SEPARATOR . $file .
                        '") [Autoload]'
                    );
                }

                if (in_array($class, self::$unmapped)) {
                    self::updateMap(
                        $class,
                        $path . DIRECTORY_SEPARATOR . $file
                    );
                }
                return true;
            }
        }

        $e = new \Exception(
            'Class ' . $class . ' could not be loaded from ' .
            $file . ', file does not exist (registered paths="' .
            implode(PATH_SEPARATOR, self::$paths) .
            '") [Autoload]'
        );
        $trace = $e->getTrace();
        if (isset($trace[2]) && isset($trace[2]['function']) &&
            in_array(
                $trace[2]['function'],
                array('class_exists', 'interface_exists')
            )) {
            return false;
        }
        if (isset($trace[1]) && isset($trace[1]['function']) &&
            in_array(
                $trace[1]['function'],
                array('class_exists', 'interface_exists')
            )) {
            return false;
        }

        // If there are other autoload functions registered,
        // let's try to play nicely with them...
        // ...otherwise, we just throw an exception.
        if (count(spl_autoload_functions()) == 1) {
            throw $e;
        }
        return false;
    }
34180
private function _deleteMigrationRecord( $class )
    {
        $name = $this->db->prepareString( $class );
        
        $query = "DELETE FROM $this->migrationTable WHERE migration_name = '$name'";
        
        $this->db->lockTables( $this->migrationTable );
        
        $result = $this->db->execute( $query );
        
        if ( $this->verbose )
        {
            echo 'Deleting: ' . $class . PHP_EOL;
        }
        
        $this->db->unlockTables();
        
        return $result === 1;
    }