@param ClassLikeStorage $storage
@param ClassLikeStorage $parent_storage

@return void
171678
protected function inheritMethodsFromParent(ClassLikeStorage $storage, ClassLikeStorage $parent_storage)
    {
        $fq_class_name = $storage->name;

        // register where they appear (can never be in a trait)
        foreach ($parent_storage->appearing_method_ids as $method_name => $appearing_method_id) {
            $aliased_method_names = [$method_name];

            if ($parent_storage->is_trait
                && $storage->trait_alias_map
            ) {
                $aliased_method_names = array_merge(
                    $aliased_method_names,
                    array_keys($storage->trait_alias_map, $method_name, true)
                );
            }

            foreach ($aliased_method_names as $aliased_method_name) {
                if (isset($storage->appearing_method_ids[$aliased_method_name])) {
                    continue;
                }

                $implemented_method_id = $fq_class_name . '::' . $aliased_method_name;

                $storage->appearing_method_ids[$aliased_method_name] =
                    $parent_storage->is_trait ? $implemented_method_id : $appearing_method_id;

                $this_method_id = strtolower($fq_class_name . '::' . $method_name);

                if (isset($storage->methods[$aliased_method_name])) {
                    $storage->potential_declaring_method_ids[$aliased_method_name] = [$this_method_id => true];
                } else {
                    if (isset($parent_storage->potential_declaring_method_ids[$aliased_method_name])) {
                        $storage->potential_declaring_method_ids[$aliased_method_name]
                            = $parent_storage->potential_declaring_method_ids[$aliased_method_name];
                    }

                    $storage->potential_declaring_method_ids[$aliased_method_name][$this_method_id] = true;

                    $parent_method_id = strtolower($parent_storage->name . '::' . $method_name);
                    $storage->potential_declaring_method_ids[$aliased_method_name][$parent_method_id] = true;
                }
            }
        }

        // register where they're declared
        foreach ($parent_storage->inheritable_method_ids as $method_name => $declaring_method_id) {
            if ($method_name !== '__construct') {
                if ($parent_storage->is_trait) {
                    $declaring_class = explode('::', $declaring_method_id)[0];
                    $declaring_class_storage = $this->classlike_storage_provider->get($declaring_class);

                    if (isset($declaring_class_storage->methods[$method_name])
                        && $declaring_class_storage->methods[$method_name]->abstract
                    ) {
                        $storage->overridden_method_ids[$method_name][] = $declaring_method_id;
                    }
                } else {
                    $storage->overridden_method_ids[$method_name][] = $declaring_method_id;
                }
            }

            $aliased_method_names = [$method_name];

            if ($parent_storage->is_trait
                && $storage->trait_alias_map
            ) {
                $aliased_method_names = array_merge(
                    $aliased_method_names,
                    array_keys($storage->trait_alias_map, $method_name, true)
                );
            }

            foreach ($aliased_method_names as $aliased_method_name) {
                if (isset($storage->declaring_method_ids[$aliased_method_name])) {
                    list($implementing_fq_class_name, $implementing_method_name) = explode(
                        '::',
                        $storage->declaring_method_ids[$aliased_method_name]
                    );

                    $implementing_class_storage = $this->classlike_storage_provider->get($implementing_fq_class_name);

                    if (!$implementing_class_storage->methods[$implementing_method_name]->abstract) {
                        continue;
                    }
                }

                $storage->declaring_method_ids[$aliased_method_name] = $declaring_method_id;
                $storage->inheritable_method_ids[$aliased_method_name] = $declaring_method_id;
            }
        }
    }
1373335
public void setStorageClass(StorageClass storageClass) {
        setStorageClass(storageClass == null ? (String)null : storageClass.toString());
    }
418902
protected function saveRelatedAttached($parent, $items) {
        foreach ($items as $row) :
            $CONTENT_PATH = $this->_uploadFile($row['content_path']);
            if ($CONTENT_PATH) :
                $PATHINFO = pathinfo($CONTENT_PATH);
                $row['content_title'] = (trim($row['content_title']) == '') ? Inflector::humanize($PATHINFO['filename']) : trim($row['content_title']);
                $row['parent'] = $parent;
                $row['content_type'] = 'attached';
                $row['content_status'] = 'inherited';
                $row['content_path'] = $CONTENT_PATH;
                $row['menu_order'] = $this->getNextMenuOrder($parent, 'attached');
                $this->_createNewContent($row);
            endif;
        endforeach;
    }
518547
static function ClassHasMany($parentclass, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
	{
		$ar = new $parentclass();
		$ar->hasMany($foreignRef, $foreignKey, $foreignClass);
	}
46229
public void setStorage(java.util.Collection<ValidStorageOptions> storage) {
        if (storage == null) {
            this.storage = null;
            return;
        }

        this.storage = new java.util.ArrayList<ValidStorageOptions>(storage);
    }
156807
private function handleParentClassNotFound(ParentClassNotFoundException $exception, &$classMap)
    {
        // Now collect all parent classes and display them then.
        $classes = array();
        while ($exception) {
            $parentClass = $exception->getParentClass();
            $classes[]   = $parentClass;
            $exception   = $exception->getPrevious();

            unset($classMap[$parentClass]);
        }
        $classes     = array_reverse($classes);
        $parentClass = array_shift($classes);
        // Check if the parent class is known in the class map.
        if (isset($this->classMap[$parentClass])) {
            // It is known, nothing we can do anymore. Next one.
            $this->logger->error(
                'Could not load class.' . "\n" .
                'class:  {class}' . "\n" .
                'file:   {file}',
                array('class' => $parentClass, 'parent' => $this->classMap[$parentClass])
            );
        }
        $logLine = '{class0}<Missing parent class!>';
        $args    = array('class0' => $parentClass);
        // Ok, top most parent is somewhere lost, log this incident.
        foreach ($classes as $class) {
            $parName        = sprintf('class%1$d', count($args));
            $logLine       .= sprintf(' <= {%1$s}', $parName);
            $args[$parName] = $class;
        }

        $this->logger->warning($logLine, $args);
    }
305590
private function registerInheritedProperties(
        $fq_class_name,
        $parent_class
    ) {
        $parent_storage = $this->storage_provider->get($parent_class);
        $storage = $this->storage_provider->get($fq_class_name);

        // register where they appear (can never be in a trait)
        foreach ($parent_storage->appearing_property_ids as $property_name => $appearing_property_id) {
            if (!$parent_storage->is_trait
                && isset($parent_storage->properties[$property_name])
                && $parent_storage->properties[$property_name]->visibility === ClassLikeAnalyzer::VISIBILITY_PRIVATE
            ) {
                continue;
            }

            $storage->appearing_property_ids[$property_name] = $appearing_property_id;
        }

        // register where they're declared
        foreach ($parent_storage->declaring_property_ids as $property_name => $declaring_property_class) {
            if (!$parent_storage->is_trait
                && isset($parent_storage->properties[$property_name])
                && $parent_storage->properties[$property_name]->visibility === ClassLikeAnalyzer::VISIBILITY_PRIVATE
            ) {
                continue;
            }

            $storage->declaring_property_ids[$property_name] = $declaring_property_class;
        }

        // register where they're declared
        foreach ($parent_storage->inheritable_property_ids as $property_name => $inheritable_property_id) {
            if (!$parent_storage->is_trait
                && isset($parent_storage->properties[$property_name])
                && $parent_storage->properties[$property_name]->visibility === ClassLikeAnalyzer::VISIBILITY_PRIVATE
            ) {
                continue;
            }

            $storage->inheritable_property_ids[$property_name] = $inheritable_property_id;
        }
    }
1313628
public function run(Storage $storage)
    {
        parent::run($storage);

        $this->checkParameters();
        $this->parameters[$this->documentFolderParameterName] = $this->storage->getDocuments()->getDocumentFolderBySlug($this->documentFolderPath);
    }
498604
protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents = [])
    {
        /** @var $class ClassMetadata */
        /** @var $parent ClassMetadata */
        if ($parent) {
            $this->addInheritedIndexes($class, $parent);
            $this->addInheritedAttributes($class, $parent);

            $class->setInheritanceType($parent->inheritanceType);
            $class->setDiscriminatorAttribute($parent->discriminatorAttribute);
            $class->setDiscriminatorMap($parent->discriminatorMap);
            $class->setDiscriminatorDefaultValue($parent->discriminatorDefaultValue);
            $class->setVersioned($parent->isVersioned);
            $class->setVersionAttribute($parent->versionAttribute);
            $class->setLifecycleCallbacks($parent->lifecycleCallbacks);
            $class->setAlsoLoadMethods($parent->alsoLoadMethods);
            $class->setChangeTrackingPolicy($parent->changeTrackingPolicy);

            if ($parent->isMappedSuperclass) {
                $class->setCustomRepositoryClass($parent->customRepositoryClassName);
            }
        }

        // Invoke driver
        try {
            $this->driver->loadMetadataForClass($class->getName(), $class);
        } catch (\ReflectionException $e) {
            throw MappingException::reflectionFailure($class->getName(), $e);
        }

        if (!$class->getIndex() && !$class->isMappedSuperclass && !$class->isEmbeddedDocument) {
            throw MappingException::hashKeyRequired($class->name);
        }

        $class->setParentClassNames($nonSuperclassParents);

        if ($parent) {
            if ($parent->isInheritanceTypeSingleTable()) {
                $class->setTable($parent->getTableName());
                $class->setRequireIndexes($parent->requireIndexes);
            } elseif ($class->requireIndexes === null) {
                $class->setRequireIndexes($parent->requireIndexes);
            }
        }

        if ($this->evm->hasListeners(Event::loadClassMetadata)) {
            $eventArgs = new LoadClassMetadataEventArgs($class, $this->dm);
            $this->evm->dispatchEvent(Event::loadClassMetadata, $eventArgs);
        }
    }
664254
public function writeToCache(ClassLikeStorage $storage, $file_path, $file_contents)
    {
        $fq_classlike_name_lc = strtolower($storage->name);
        $cache_location = $this->getCacheLocationForClass($fq_classlike_name_lc, $file_path, true);
        $storage->hash = $this->getCacheHash($file_path, $file_contents);

        if ($this->config->use_igbinary) {
            file_put_contents($cache_location, igbinary_serialize($storage));
        } else {
            file_put_contents($cache_location, serialize($storage));
        }
    }
933408
private function processCategory(array $element, $parent = null)
    {
        if ($this->isMasterCategory($element)) {
            $this->createCategory($element, MasterCategoryElement::class, $this->parseResult);
        }

        if ($this->isResourceGroup($element)) {
            $this->createCategory($element, ResourceGroupElement::class, $parent);
        }

        if ($this->isDataStructureCategory($element)) {
            $this->createCategory($element, DataStructureCategoryElement::class, $parent);
        }
    }
829701
public function listAction(Request $request, $parent, $class = ResourceNode::class)
    {
        $options = $request->query->all();

        if ($parent) {
            // grab directory content
            $parentNode = $this->om
                ->getRepository(ResourceNode::class)
                ->findOneBy(['uuid' => $parent]);

            $options['hiddenFilters']['parent'] = $parentNode ? $parentNode->getId() : null;

            if ($parentNode) {
                $permissions = $this->rightsManager->getCurrentPermissionArray($parentNode);

                if (!isset($permissions['administrate']) || !$permissions['administrate']) {
                    $options['hiddenFilters']['published'] = true;
                    $options['hiddenFilters']['hidden'] = false;
                }
            }
        } else {
            $options['hiddenFilters']['parent'] = null;
        }
        $options['hiddenFilters']['active'] = true;
        $options['hiddenFilters']['resourceTypeEnabled'] = true;

        //fix the very large list at the root
        //todo: when impersonating is fixed for easy testing, do that kind of stuff everywhere (not only at the root level)
        //directly in the finder
        //it currently work (altough we can see stuff we shouldnt do through the api)

        $roles = array_map(
            function ($role) { return $role->getRole(); },
            $this->container->get('security.token_storage')->getToken()->getRoles()
        );

        if (!in_array('ROLE_ADMIN', $roles) || null === $options['hiddenFilters']['parent']) {
            $options['hiddenFilters']['roles'] = $roles;
        }

        return new JsonResponse(
            $this->finder->search(ResourceNode::class, $options)
        );
    }
327686
public function run(Storage $storage)
    {
        parent::run($storage);

        $components = $this->getParametersWithoutNamespace();

        foreach ($components as $namespace => $component) {
            $this->loadComponent($namespace, $component);
        }
    }
677791
public static function init() {

		if(is_null(self::$storage)) {
			self::$storage = new NativeSessionStorage();
		}

		self::$storage->start();
		
	}
1096075
private function ensureParentAndKey($parent, $key)
    {
        if (!$this->parent)
        {
            $this->parent = $parent;
        }
        if (!$this->key)
        {
            $this->key = $key;
        }
        if ($this->parent != $parent)
        {
            throw new \Exception('Internal Error. Relation retrieved from two different Objects.');
        }
        if ($this->key != $key)
        {
            throw new \Exception('Internal Error. Relation retrieved from two different keys.');
        }
    }
83948
public function queueClassLikesForScanning(
        Codebase $codebase,
        FileStorage $file_storage = null,
        array $phantom_classes = []
    ) {
        foreach ($this->types as $atomic_type) {
            $atomic_type->queueClassLikesForScanning(
                $codebase,
                $file_storage,
                $phantom_classes
            );
        }
    }
381642
public function cacheClassLikeStorage(ClassLikeStorage $classlike_storage, $file_path)
    {
        $file_contents = $this->file_provider->getContents($file_path);

        if ($this->classlike_storage_provider->cache) {
            $this->classlike_storage_provider->cache->writeToCache($classlike_storage, $file_path, $file_contents);
        }
    }