Initializes object data structure.
Either by trying to load from cache or by calling $this->_getNonCachedFieldNames

@param bool $forceFullStructure Set to true if you want to load full structure in any case.
15293
protected function _initDataStructure($forceFullStructure = false)
    {
        $myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();

        //get field names from cache
        $fieldNamesList = null;
        $fullCacheKey = 'fieldnames_' . $this->getCoreTableName() . '_' . $this->_sCacheKey;
        if ($this->_sCacheKey && !$this->_isDisabledFieldCache()) {
            $fieldNamesList = $myUtils->fromFileCache($fullCacheKey);
        }

        if (!$fieldNamesList) {
            $fieldNamesList = $this->_getNonCachedFieldNames($forceFullStructure);
            if ($this->_sCacheKey && !$this->_isDisabledFieldCache()) {
                $myUtils->toFileCache($fullCacheKey, $fieldNamesList);
            }
        }

        if ($fieldNamesList !== false) {
            foreach ($fieldNamesList as $field => $status) {
                $this->_addField($field, $status);
            }
        }
    }
119908
private function lazyParseStructure(): void
    {
        if (true === $this->structureParsed) {
            return;
        }
        $this->structureParsed = true;

        $this->lazyLoadStructure();

        $this->type = self::$typesMap[$this->structure->type] ?? self::TYPE_UNKNOWN;

        // In our context, \ENCOTHER is as useful as an uknown encoding
        $this->encoding = self::$encodingsMap[$this->structure->encoding] ?? self::ENCODING_UNKNOWN;
        $this->subtype  = $this->structure->subtype;

        if (isset($this->structure->bytes)) {
            $this->bytes = $this->structure->bytes;
        }
        if ($this->structure->ifdisposition) {
            $this->disposition = $this->structure->disposition;
        }
        if ($this->structure->ifdescription) {
            $this->description = $this->structure->description;
        }

        $this->parameters = new Parameters();
        if ($this->structure->ifparameters) {
            $this->parameters->add($this->structure->parameters);
        }

        if ($this->structure->ifdparameters) {
            $this->parameters->add($this->structure->dparameters);
        }

        // When the message is not multipart and the body is the attachment content
        // Prevents infinite recursion
        if (self::isAttachment($this->structure) && !$this instanceof Attachment) {
            $this->parts[] = new Attachment($this->resource, $this->getNumber(), '1', $this->structure);
        }

        if (isset($this->structure->parts)) {
            $parts = $this->structure->parts;
            // https://secure.php.net/manual/en/function.imap-fetchbody.php#89002
            if ($this instanceof Attachment && $this->isEmbeddedMessage() && 1 === \count($parts) && \TYPEMULTIPART === $parts[0]->type) {
                $parts = $parts[0]->parts;
            }
            foreach ($parts as $key => $partStructure) {
                $partNumber = (!$this instanceof Message) ? $this->partNumber . '.' : '';
                $partNumber .= (string) ($key + 1);

                $newPartClass = self::isAttachment($partStructure)
                    ? Attachment::class
                    : SimplePart::class
                ;

                $this->parts[] = new $newPartClass($this->resource, $this->getNumber(), $partNumber, $partStructure);
            }
        }
    }
274295
public static function init($model, $propertyName, $annotation, $forceInit = false)
    {
        $className = BeanFactory::getObjectClass($model);

        if(!$forceInit)
        {
            $autoSelect = AnnotationManager::getPropertyAnnotations($className, $propertyName, AutoSelect::class)[0] ?? null;
            if($autoSelect && !$autoSelect->status)
            {
                return;
            }
        }

        if(is_array($annotation))
        {
            $firstAnnotation = reset($annotation);
            if($firstAnnotation instanceof \Imi\Model\Annotation\Relation\PolymorphicToOne)
            {
                static::initByPolymorphicToOne($model, $propertyName, $annotation);
            }
        }
        else if($annotation instanceof \Imi\Model\Annotation\Relation\OneToOne)
        {
            static::initByOneToOne($model, $propertyName, $annotation);
        }
        else if($annotation instanceof \Imi\Model\Annotation\Relation\OneToMany)
        {
            static::initByOneToMany($model, $propertyName, $annotation);
        }
        else if($annotation instanceof \Imi\Model\Annotation\Relation\ManyToMany)
        {
            static::initByManyToMany($model, $propertyName, $annotation);
        }
        else if($annotation instanceof \Imi\Model\Annotation\Relation\PolymorphicOneToOne)
        {
            static::initByPolymorphicOneToOne($model, $propertyName, $annotation);
        }
        else if($annotation instanceof \Imi\Model\Annotation\Relation\PolymorphicOneToMany)
        {
            static::initByPolymorphicOneToMany($model, $propertyName, $annotation);
        }
        else if($annotation instanceof \Imi\Model\Annotation\Relation\PolymorphicManyToMany)
        {
            static::initByPolymorphicManyToMany($model, $propertyName, $annotation);
        }
        else if($annotation instanceof \Imi\Model\Annotation\Relation\PolymorphicToMany)
        {
            static::initByPolymorphicToMany($model, $propertyName, $annotation);
        }
    }
424911
public function createVersionInfoFromCreateStruct(CreateStruct $struct, $versionNo)
    {
        $versionInfo = new VersionInfo();

        $versionInfo->id = null;
        $versionInfo->contentInfo = $this->createContentInfoFromCreateStruct($struct, $versionNo);
        $versionInfo->versionNo = $versionNo;
        $versionInfo->creatorId = $struct->ownerId;
        $versionInfo->status = VersionInfo::STATUS_DRAFT;
        $versionInfo->initialLanguageCode = $this->languageHandler->load($struct->initialLanguageId)->languageCode;
        $versionInfo->creationDate = $struct->modified;
        $versionInfo->modificationDate = $struct->modified;
        $versionInfo->names = $struct->name;

        $languages = [];
        foreach ($struct->fields as $field) {
            if (!isset($languages[$field->languageCode])) {
                $languages[$field->languageCode] = true;
            }
        }
        $versionInfo->languageCodes = array_keys($languages);

        return $versionInfo;
    }
551142
public function setStructureNodeRelatedByStructureNodeId(ChildStructureNode $v = null)
    {
        if ($v === null) {
            $this->setStructureNodeId(NULL);
        } else {
            $this->setStructureNodeId($v->getId());
        }

        $this->aStructureNodeRelatedByStructureNodeId = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildStructureNode object, it will not be re-added.
        if ($v !== null) {
            $v->addStructureNodeParentRelatedByStructureNodeId($this);
        }


        return $this;
    }
1120112
public function setStructureNodeRelatedByParentId(ChildStructureNode $v = null)
    {
        if ($v === null) {
            $this->setParentId(NULL);
        } else {
            $this->setParentId($v->getId());
        }

        $this->aStructureNodeRelatedByParentId = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildStructureNode object, it will not be re-added.
        if ($v !== null) {
            $v->addStructureNodeParentRelatedByParentId($this);
        }


        return $this;
    }
498439
protected static function initialize() {
		if(file_exists("cache/dachi.modules.json")) {
			$modules = json_decode(file_get_contents("cache/dachi.modules.json"));

			foreach($modules as $module)
				self::$modules[$module->shortname] = new Module($module);
		}
	}
898927
public function init()
    {
        parent::init();

        // Add in our Twig extensions
        Craft::$app->view->registerTwigExtension(new AgnosticFetchTwigExtension());

        Event::on(CraftVariable::class, CraftVariable::EVENT_INIT, function(Event $event) {
            /** @var CraftVariable $variable */
            $variable = $event->sender;
            $variable->set('agnosticfetch', AgnosticFetchVariable::class);
        });
    }
459042
function init(){
    if(!cacheServiceConfig) {
      cacheServiceConfig = {};
    }
    self.nameSpace = cacheServiceConfig.nameSpace || '';
    self.verbose = (typeof cacheServiceConfig.verbose === 'boolean') ? cacheServiceConfig.verbose : false;
    self.writeToVolatileCaches = (typeof cacheServiceConfig.writeToVolatileCaches === 'boolean') ? cacheServiceConfig.writeToVolatileCaches : true;
    self.caches = new CacheCollection({nameSpace: self.nameSpace, verbose: self.verbose}, cacheModules).caches;
    self.cachesLength = self.caches.length;
  }
221456
public function mapObjectToCreateStruct(ContentCreateStruct $createStruct)
    {
        // Name collection (ez => transfer)
        $keys = array(
            'mainLanguageCode' => 'main_language_code',
            'remoteId' => 'remote_id',
        );

        $this->arrayToStruct($createStruct, $keys);

        $this->assignStructFieldValues($createStruct);

        $this->callStruct($createStruct);
    }
841506
private function createContentInfoFromCreateStruct(CreateStruct $struct, $currentVersionNo = 1)
    {
        $contentInfo = new ContentInfo();

        $contentInfo->id = null;
        $contentInfo->contentTypeId = $struct->typeId;
        $contentInfo->sectionId = $struct->sectionId;
        $contentInfo->ownerId = $struct->ownerId;
        $contentInfo->alwaysAvailable = $struct->alwaysAvailable;
        $contentInfo->remoteId = $struct->remoteId;
        $contentInfo->mainLanguageCode = $this->languageHandler
            ->load(isset($struct->mainLanguageId) ? $struct->mainLanguageId : $struct->initialLanguageId)
            ->languageCode;
        $contentInfo->name = isset($struct->name[$contentInfo->mainLanguageCode])
            ? $struct->name[$contentInfo->mainLanguageCode]
            : '';
        // For drafts published and modified timestamps should be 0
        $contentInfo->publicationDate = 0;
        $contentInfo->modificationDate = 0;
        $contentInfo->currentVersionNo = $currentVersionNo;
        $contentInfo->status = ContentInfo::STATUS_DRAFT;
        $contentInfo->isPublished = false;

        return $contentInfo;
    }
1080608
public function structureMetadata()
    {
        if ($this->structureMetadata === null || $this->isStructureFinalized === false) {
            $this->structureMetadata = $this->loadStructureMetadata();
        }

        return $this->structureMetadata;
    }
725508
@PostConstruct
  public void initialize() {

    if (this.pojoDescriptorBuilderFactory == null) {
      this.pojoDescriptorBuilderFactory = PojoDescriptorBuilderFactoryImpl.getInstance();
    }
    if (this.pojoDescriptorBuilder == null) {
      this.pojoDescriptorBuilder = this.pojoDescriptorBuilderFactory.createPrivateFieldDescriptorBuilder();
    }
    this.descriptor = this.pojoDescriptorBuilder.getDescriptor(EntityTo.class);
  }
1318885
protected function ensureInitialized($blockType)
    {
        if ($blockType instanceof BlockTypeInterface) {
            $name = $blockType->getName();
            $type = $blockType;
        } else {
            $name = $blockType;
            $type = null;
        }

        if (!isset($this->types[$name])) {
            if (!$type) {
                $type = $this->registry->getType($name);
            }

            $types      = [$type];
            $typeName   = $type->getName();
            $names      = [$typeName];
            $nameMap    = [$typeName => true];
            $parentName = $type->getParent();
            while ($parentName) {
                if (isset($this->types[$parentName])) {
                    // use data from already loaded parent type
                    $types   = array_merge($this->types[$parentName], array_reverse($types));
                    $names   = array_merge($this->names[$parentName], array_reverse($names));
                    $nameMap = array_merge($nameMap, $this->nameMap[$parentName]);
                    break;
                } else {
                    $type     = $this->registry->getType($parentName);
                    $typeName = $type->getName();

                    $types[]            = $type;
                    $names[]            = $typeName;
                    $nameMap[$typeName] = true;

                    $parentName = $type->getParent();
                }
            }

            if (null === $parentName) {
                $types = array_reverse($types);
                $names = array_reverse($names);
            }

            $this->types[$name]   = $types;
            $this->names[$name]   = $names;
            $this->nameMap[$name] = $nameMap;

            // initialise all parent types if them are not initialized yet
            $typeNames = array_keys($nameMap);
            $offset    = 0;
            while (false !== ($typeName = next($typeNames))) {
                if (isset($this->nameMap[$typeName])) {
                    break;
                }

                $offset++;
                $this->types[$typeName]   = array_slice($types, 0, -$offset);
                $this->names[$typeName]   = array_slice($names, 0, -$offset);
                $this->nameMap[$typeName] = array_slice($nameMap, $offset);
            }
        }

        return $name;
    }
995120
public function setStructureNode(ChildStructureNode $v = null)
    {
        if ($v === null) {
            $this->setId(NULL);
        } else {
            $this->setId($v->getId());
        }

        $this->aStructureNode = $v;

        // Add binding for other direction of this 1:1 relationship.
        if ($v !== null) {
            $v->setFunctionPhase($this);
        }


        return $this;
    }
1178524
public static function init()
    {
        if(static::$isInited)
        {
            throw new \RuntimeException('MemoryTableManager can not repeated init');
        }
        foreach(static::$tables as $name => $option)
        {
            $table = new \Swoole\Table($option['size'] ?? 1024, $option['conflictProportion'] ?? 0.2);
            foreach($option['columns'] as $column)
            {
                $table->column($column['name'], $column['type'] ?? swoole_table::TYPE_STRING, $column['size'] ?? 0);
            }
            if(!$table->create())
            {
                throw new \RuntimeException('MemoryTableManager create table failed');
            }
            static::$tables[$name] = $table;
        }
        static::$isInited = true;
    }
1150437
protected function init()
    {
        $structure = $this->imapFetchstructure();
        $this->structure = $structure;
        if (isset($structure->parts)) {
            $countSection = count($structure->parts);
            $this->countAttachment = $countSection - 1;
        }
        $this->getCountSection();
        $this->getHeader();
        $this->getAttachments();
        $this->getBody();
        if ($this->_decode === self::DECODE) {
            $this->decode();
        }
    }