Helper method to initialize a lazy loading proxy or persistent collection.

@param object $obj

@return void
554330
public function initializeObject($obj)
    {
        if ($obj instanceof Proxy) {
            $obj->__load();
        } elseif ($obj instanceof PersistentCollectionInterface) {
            $obj->initialize();
        }
    }
362664
public function initializeObject()
    {
        if ($this->request === null) {
            $httpRequest = Request::createFromEnvironment();
            $this->request = $this->objectManager->get(\TYPO3\Flow\Mvc\ActionRequest::class, $httpRequest);
        }

        $uriBuilder = new UriBuilder();
        $uriBuilder->setRequest($this->request);

        $this->setControllerContext(new ControllerContext(
            $this->request,
            new Response(),
            new Arguments(array()),
            $uriBuilder
        ));
    }
675870
protected function initialize()
    {
        if (is_array($this->objectIdentifiers)) {
            foreach ($this->objectIdentifiers as $identifier) {
                try {
                    parent::attach($this->persistenceManager->getObjectByIdentifier($identifier));
                } catch (Exception\InvalidObjectDataException $exception) {
                    // when security query rewriting holds back an object here, we skip it...
                }
            }
            $this->objectIdentifiers = null;
        }
    }
390123
public function setSection($obj)
    {
        if ($obj instanceof SectionInterface) {
            $this->section = $obj;
        } else {
            $this->createSection();

            $this->section->load($obj);
        }

        return $this;
    }
42767
protected function add(ModelObject $obj)
    {
        // Check that all required fields exist.
        $this->getErrors()->validateModelObject($obj);

        if ($this->dao->slugExists($obj->Slug))
            $this->errors->reject("The slug for this ".get_class($obj)." record is already in use.");
    }
128020
public function bind($bindObject) {
        // Loop over object and set property value
        foreach ($bindObject as $key => $value) {
            ObjectUtils::setNestedObjectProperty($value, $this, $key);
        }
    }
396956
private function init(string $url): void
    {
        $this->resource = curl_init($url);

        curl_setopt($this->resource, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($this->resource, CURLOPT_CONNECTTIMEOUT, $this->loader->getTimeout());
        curl_setopt($this->resource, CURLOPT_USERAGENT, $this->loader->getUserAgent());
        curl_setopt($this->resource, CURLOPT_HEADER, true);
        curl_setopt($this->resource, CURLINFO_HEADER_OUT, true);

        // check and set proxy settings
        $proxy_host = $this->loader->getOption('ProxyHost');

        if (null !== $proxy_host) {
            // check for supported protocol
            $proxy_protocol = $this->loader->getOption('ProxyProtocol');

            if (null !== $proxy_protocol) {
                $allowedProtocolls = [StreamCreator::PROXY_PROTOCOL_HTTP, StreamCreator::PROXY_PROTOCOL_HTTPS];

                if (!in_array($proxy_protocol, $allowedProtocolls)) {
                    throw new Exception(
                        'Invalid/unsupported value "' . $proxy_protocol . '" for option "ProxyProtocol".',
                        Exception::INVALID_OPTION
                    );
                }
            } else {
                $proxy_protocol = StreamCreator::PROXY_PROTOCOL_HTTP;
            }

            $proxy_port = $this->loader->getOption('ProxyPort');

            // set basic proxy options
            curl_setopt($this->resource, CURLOPT_PROXY, $proxy_protocol . '://' . $proxy_host);
            if (null !== $proxy_port) {
                curl_setopt($this->resource, CURLOPT_PROXYPORT, $proxy_port);
            }

            // check auth settings
            $proxy_user = $this->loader->getOption('ProxyUser');

            // set proxy auth options
            if (null !== $proxy_user) {
                $proxy_password = $this->loader->getOption('ProxyPassword');

                $proxy_auth = $this->loader->getOption('ProxyAuth');
                if (null !== $proxy_auth) {
                    $allowedAuth = [StreamCreator::PROXY_AUTH_BASIC, StreamCreator::PROXY_AUTH_NTLM];

                    if (!in_array($proxy_auth, $allowedAuth)) {
                        throw new Exception(
                            'Invalid/unsupported value "' . $proxy_auth . '" for option "ProxyAuth".',
                            Exception::INVALID_OPTION
                        );
                    }
                } else {
                    $proxy_auth = StreamCreator::PROXY_AUTH_BASIC;
                }

                if (StreamCreator::PROXY_AUTH_NTLM === $proxy_auth) {
                    curl_setopt($this->resource, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
                }
                curl_setopt($this->resource, CURLOPT_PROXYUSERPWD, $proxy_user . ':' . $proxy_password);
            }
        }
    }
944338
function _storeObject($elObj) 
    {
        $name = $elObj->name;
        if(is_object($this->_currentGroup) && $elObj->type != 'group') {
            $this->_currentGroup->elements[] = $elObj;
        } elseif (isset($this->_currentSection)) {
            $this->_obj->sections[$this->_currentSection]->elements[] = $elObj;
        } else {
            $this->_obj->elements[] = $elObj;
        }
    }
760566
public function initialize()
    {
        if ($this->initialized || ! $this->mapping) {
            return;
        }

        $newObjects = array();

        if ($this->isDirty) {
            // Remember any NEW objects added through add()
            $newObjects = $this->coll->toArray();
        }

        $this->coll->clear();
        $this->uow->loadCollection($this);
        $this->takeSnapshot();

        // Reattach any NEW objects added through add()
        if ($newObjects) {
            foreach ($newObjects as $key => $obj) {
                if ($this->mapping['strategy'] === 'set') {
                    $this->coll->set($key, $obj);
                } else {
                    $this->coll->add($obj);
                }
            }

            $this->isDirty = true;
        }

        $this->mongoData = array();
        $this->initialized = true;
    }
223953
public function initializeObject()
    {
        if ($this->browserRequestEngine instanceof DependencyProxy) {
            $this->browserRequestEngine->_activateDependency();
        }
        $this->browser->setRequestEngine($this->browserRequestEngine);
    }
640449
private void initReader(Object obj) {
		if (obj instanceof WorkingDirectoryLocationAware) {
			((WorkingDirectoryLocationAware) obj).setWorkingDirectory(workingDirectory);
		}
		if (obj instanceof ServletContextAware) {
			((ServletContextAware) obj).setServletContext(servletContext);
		}

		if (obj instanceof ResourceBrowser) {
			if (obj instanceof ResourceGenerator) {
				resourceGeneratorInfoProviders.add(0, (ResourceBrowser) obj);
			} else {
				servletCtxResourceBrowser = (ResourceBrowser) obj;
			}
		}
	}
1048405
private function initialize(object $object, string $original, string $inverted): void
    {
        $this->initMethod($object, $original, true);
        $this->initMethod($object, $inverted, false);
    }
124418
public function inPile($obj)
    {
        $db = Loader::db();
        $v = array();
        $class = strtoupper(get_class($obj));
        switch ($class) {
            case "COLLECTION":
                $v = array("COLLECTION", $obj->getCollectionID());
                break;
            case "BLOCK":
                $v = array("BLOCK", $obj->getBlockID());
                break;
        }
        $v[] = $this->getPileID();
        $q = "select pcID from PileContents where itemType = ? and itemID = ? and pID = ?";
        $pcID = $db->getOne($q, $v);

        return $pcID > 0;
    }
492950
public function setValue($value, $obj = null)
    {
        // If we're not passed a value directly,
        // we can look for it in a relation method on the object passed as a second arg
        if ($obj instanceof DataObject) {
            $this->loadFrom($obj);
        } else {
            parent::setValue($value);
        }
        return $this;
    }
1274795
public function associateObject($obj, $objectName = '') {
        $className = get_class($obj);
        if($objectName == '') $objectName = $className;
        //if(!$this->objectAlreadyLoaded($objectName) && !$this->objectExistsInContext($objectName)) {

            $instantiator = new Instantiator(array('id'=>$objectName, 'class'=>$className),$this);
            $this->addObjectContext($instantiator->getNewDefinition());

            $pClass = 'SingletonPattern';

            $p = new $pClass($instantiator);
            $p->instance =& $obj;

            $cp = new ObjectService($objectName);
            $cp->setPattern($p);
            $this->addObject($cp);
            return $obj;
        //}
        //return $this->object($objectName);
    }
625410
public static function setup(/* mixed */ $obj): void
    {
        if($obj instanceof Graph\GraphInterface) {
            Hooks\Graph::setup($obj);
        }
        // . (on purpose)
        if($obj instanceof Graph\EdgeInterface) {
            Hooks\Edge::setup($obj);
        }
        elseif($obj instanceof Graph\NodeInterface) {
            Hooks\Node::setup($obj);
        }
        elseif($obj instanceof AbstractNotification) {
            Hooks\Notification::setup($obj);
        }
    }
443089
protected function loadObject()
    {
        $this->object = $this->proxy->getVersionInfo()->getContentInfo();
        $this->proxy = null;
    }