Hydrate from a LDAP entry

@param EntryInterface $entry Entry to use for loading

@return void
515130
public function hydrateFromEntry(EntryInterface $entry)
    {
        $this->dn = $entry->getDn();

        $this->attributes = array();

        foreach ($entry->getAttributes() as $name => $data) {
            $attr = new NodeAttribute($name);
            $attr->add($data);
            $this->mergeAttribute($attr);
        }

        $this->snapshot();
    }
1303369
public function addEntry(AbstractEntry $entry, $prepend = false) {
        if ($prepend) {
            array_unshift($this->entries, $entry);
        } else {
            $this->entries[] = $entry;
        }
    }
947702
public function deleteEntry($dn)
    {
        if (! (@ldap_delete($this->connection, $dn))) {
            $code = @ldap_errno($this->connection);
            throw new PersistenceException(
                sprintf(
                    'Could not delete entry %s: Ldap Error Code=%s - %s',
                    $dn,
                    $code,
                    ldap_err2str($code)
                )
            );
        }
    }
815909
public function store(CacheEntry $entry)
    {
        if (null === $entry->expirationTimestamp()) {
            $expirationTimestamp = 0; // Never expires.
        } else {
            $expirationTimestamp = $entry->expirationTimestamp();
        }

        if (!$this->getConnection()->set($entry->id(), $entry, $expirationTimestamp)) {
            return $this->failure('Failed to store data into memcache server.');
        }
    }
801819
public function modifyBatch($dn, array $entry)
    {
        if ($this->suppressErrors) {
            return @ldap_modify_batch($this->getConnection(), $dn, $entry);
        }

        return ldap_modify_batch($this->getConnection(), $dn, $entry);
    }
1361444
public static function hydrate(stdClass $profile)
    {
        $hydrated = new ProfileEntity();

        if (isset($profile->id)) {
            $hydrated->setId($profile->id);
        }

        if (isset($profile->name)) {
            $hydrated->setName($profile->name);
        }

        if (isset($profile->setting)) {
            $hydrated->setSetting(SettingHydrator::hydrate($profile->setting));
        }

        if (isset($profile->controllers) && is_array($profile->controllers)) {
            $hydrated->setControllers(ControllerHydrator::hydrateCollection($profile->controllers));
        }

        if (isset($profile->sources) && is_array($profile->sources)) {
            $hydrated->setSources(SourceHydrator::hydrateCollection($profile->sources));
        }

        if (isset($profile->sinks) && is_array($profile->sinks)) {
            $hydrated->setSinks(SinkHydrator::hydrateCollection($profile->sinks));
        }

        if (isset($profile->validators) && is_array($profile->validators)) {
            $hydrated->setValidators(ValidatorHydrator::hydrateCollection($profile->validators));
        }

        if (isset($profile->sanitizers) && is_array($profile->sanitizers)) {
            $hydrated->setSanitizers(SanitizerHydrator::hydrateCollection($profile->sanitizers));
        }

        if (isset($profile->ignored_codes) && is_array($profile->ignored_codes)) {
            $hydrated->setIgnoredCodes(IgnoredCodeHydrator::hydrateCollection($profile->ignored_codes));
        }

        if (isset($profile->ignored_locations) && is_array($profile->ignored_locations)) {
            $hydrated->setIgnoredLocations(IgnoredLocationHydrator::hydrateCollection($profile->ignored_locations));
        }

        if (isset($profile->extensions) && is_array($profile->extensions)) {
            $hydrated->setExtensions(ExtensionHydrator::hydrateCollection($profile->extensions));
        }

        if (isset($profile->application)) {
            $hydrated->setApplication(ApplicationHydrator::hydrate($profile->application));
        }

        if (isset($profile->created_by)) {
            $hydrated->setCreatedBy(UserHydrator::hydrate($profile->created_by));
        }

        if (isset($profile->default)) {
            $hydrated->setDefault($profile->default);
        }

        return $hydrated;
    }
787807
public static function login(UserInterface $user): void
    {
        Session::regenerate(false);
        Session::put('wt_user', $user->id());
    }
95348
public function hydrate(array $data, $object)
    {
        if (!$object instanceof TicketCategory) {
            throw new \InvalidArgumentException('$object must be an instance of TicketCategory');
        }

        return parent::hydrate($data, $object);
    }
1112951
public function hydrate(JsonApiRequestInterface $request, ExceptionFactoryInterface $exceptionFactory, $domainObject)
    {
        return $this->hydrateForUpdate($request, $exceptionFactory, $domainObject);
    }
995731
private function projectEntry(Entry $entry)
    {
        $date = $entry->getDateCreated();
        if ($date) {
            yield 'ccm_date_created' => $this->dateFormatter->formatCustom(\DateTime::ATOM, $date);
        } else {
            yield 'ccm_date_created' => null;
        }

        $attributes = $entry->getAttributes();
        foreach ($attributes as $attribute) {
            yield $attribute->getAttributeKey()->getAttributeKeyHandle() => $attribute->getPlainTextValue();
        }
    }
1137102
private function sendEntry(Entry $entry)
    {
        if ($this->batchEnabled) {
            $this->batchRunner->submitItem($this->identifier, $entry);
            return;
        }

        $this->logger->write($entry);
    }
521589
public function addEntry(LdifEntryInterface ...$entries)
    {
        foreach ($entries as $entry) {
            $this->entries[] = $entry;
        }

        return $this;
    }
686367
public function hydrate(array $data, $object)
    {
        if (!$object instanceof SecretQuestion) {
            throw new \Exception('$object must be an instance of SecretQuestion');
        }

        return parent::hydrate($data, $object);
    }
1226133
private function addWithFormattedHour(
		EntryInterface $entry,
		$dateTimeFormat
	) {
		$entryKey = $this->generateEntryKey(
			$entry->getToken(),
			$entry->getEvent(),
			$entry->getCreatedAt()->format($dateTimeFormat)
		);

		$entryType = $entry->getType();

		/**
		 * If the entry must be treated as a beacon.
		 */
		if ($entryType & ElcodiMetricTypes::TYPE_BEACON_UNIQUE) {
			$this->addBeaconMetricUnique($entry, $entryKey);
		}

		/**
		 * If the entry must be treated as a beacon.
		 */
		if ($entryType & ElcodiMetricTypes::TYPE_BEACON_TOTAL) {
			$this->addBeaconMetricTotal($entryKey);
		}

		/**
		 * If the entry must be treated as an accumulated metric.
		 */
		if ($entryType & ElcodiMetricTypes::TYPE_ACCUMULATED) {
			$this->addAccumulativeEntry($entry, $entryKey);
		}

		/**
		 * If the entry must be treated as a distributed metric.
		 */
		if ($entryType & ElcodiMetricTypes::TYPE_DISTRIBUTIVE) {
			$this->addDistributedEntry($entry, $entryKey);
		}

		return $this;
	}
1295634
public function addEntry($dn, $data)
    {
        $data = $this->normalizeData($data);

        if (! (@ldap_add($this->connection, $dn, $data))) {
            $code = @ldap_errno($this->connection);
            throw new PersistenceException(
                sprintf(
                    'Could not add entry %s: Ldap Error Code=%s - %s',
                    $dn,
                    $code,
                    ldap_err2str($code)
                )
            );
        }
    }
1197349
protected function hydrateModel($primaryKey)
    {
        try {
            $query = $this->prepareQuery();
            $this->model = $this->findPk($query, $primaryKey);
        } catch (\Exception $e) {
            Logger::log(get_class($this) . ': ' . $e->getMessage(), LOG_ERR);
        }
    }
282043
public function set(string $id, array $entry): StorageCacheInterface
    {
        $this->cache[$id] = $entry;

        return $this;
    }