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

@param object $obj

@return void
979029
public function initializeObject($obj)
    {
        if ($obj instanceof Proxy) {
            $obj->__load();

            return;
        }

        if ($obj instanceof PersistentCollection) {
            $obj->initialize();
        }
    }
948166
public function loadFromArray ($object)
    {
        parent::loadFromArray($object);

        if (!empty($this->recipients->items)) {
            foreach($this->recipients->items AS &$item) {
                $Recipient = new Recipient();
                $Recipient->loadFromArray($item);

                $item = $Recipient;
            }
        }
788701
public static void init(Object object)
	{
		if (object instanceof Collection)
		{
			initCollection((Collection<?>)object);
		}
		else if (object instanceof Marshalizable)
		{
			Marshalizable m = (Marshalizable)object;
			m.marshallize();
		}
	}
192591
public function initializeObject()
    {
        $client = new \Raven_Client($this->dsn);
        $errorHandler = new \Raven_ErrorHandler($client, true);
        $errorHandler->registerShutdownFunction();
        $this->client = $client;

        $this->setTags();
        $this->setEnvironment();
        $this->setRelease();
        $this->setAppPath();
        $this->setPrefixes();

        $this->emitSentryClientCreated($client);
    }
414687
private function writeAuthObj($obj){
        if($obj === null || (isset($obj['is_read']) && $obj['is_read'] === true)){
            return;
        }

        $obj['time'] = time();
        $obj['is_cloud_user'] = $this->isCloudUser;
        @file_put_contents($this->getAuthFilePath(), json_encode($obj));
    }
1308693
public static function transform($obj)
    {
        if (is_array($obj) || is_object($obj)) {
            foreach ($obj as &$object) {
                if (isset($object->status)) {
                    self::transformObject($object);
                }

                self::transform($object);
            }
        }
    }
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.");
    }
923926
public function initializeObject()
    {
        /** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */
        $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
        $querySettings->setRespectStoragePage(false);
        $this->setDefaultQuerySettings($querySettings);
        $this->backendLayoutView = GeneralUtility::makeInstance(\MASK\Mask\Backend\BackendLayoutView::class);
    }
128020
public function bind($bindObject) {
        // Loop over object and set property value
        foreach ($bindObject as $key => $value) {
            ObjectUtils::setNestedObjectProperty($value, $this, $key);
        }
    }
1220258
public function persist(IdentifiableObject $object): void
    {
        $id = (string)$object->id();

        $allData = $this->loadAllObjects();
        $allData[$id] = $object;
        $this->saveAllObjects($allData);

        stdout(line(make_cyan('Persisted'), get_class($object), ':', $id));
    }
380522
public void init(ObjectMapper objectMapper) {
		if (!initialized) {
			this.initialized = true;
			this.objectMapper = objectMapper;
			this.objectMapper.registerModules(getJacksonModules());

			applyRepositoryRegistration(resourceRegistry);

			for (Module module : modules) {
				if (module instanceof InitializingModule) {
					((InitializingModule) module).init();
				}
			}
		}
	}
8247
public function loadCollection(PersistentCollection $collection)
    {
        $this->getDocumentPersister(get_class($collection->getOwner()))->loadCollection($collection);
    }
116756
public static function toObject(&$obj, $arr) {
        if (is_object($obj) && is_array($arr)) {
            foreach($arr as $key=>$val) {
                $obj->$key = $val;
            }
        }
    }
694843
private function initializeMapper() {
    // set the mapper
    $persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
    if ($persistenceFacade->isKnownType($this->type)) {
      $this->mapper = $persistenceFacade->getMapper($this->type);
    }
    else {
      // initialize null mapper if not done already
      if (self::$nullMapper == null) {
        self::$nullMapper = new NullMapper();
      }
      $this->mapper = self::$nullMapper;
    }
  }
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);
        }
    }
1338895
public function setValue($object, $value = null)
    {
        if (! ($object instanceof Proxy && ! $object->__isInitialized())) {
            parent::setValue($object, $value);

            return;
        }

        $originalInitializer = $object->__getInitializer();
        $object->__setInitializer(null);
        parent::setValue($object, $value);
        $object->__setInitializer($originalInitializer);
    }
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;
        }
    }