@param IPersistHook $persistHook

@return bool
767107
public function isPersistHookIgnored(IPersistHook $persistHook) : bool
    {
        if (empty($this->ignorePersistHookStack)) {
            return false;
        }

        return in_array($persistHook, end($this->ignorePersistHookStack), true);
    }
621085
public function set($ip)
    {
        if (is_long($ip)) {
            $ip = long2ip($ip);
        }

        Assertion::ip($ip);

        $this->callMethod('setip', compact('ip'));

        return true;
    }
373504
public function markAsPersisted(): void
    {
        $this->markNew(false);
        $this->dispatchEvent(new Event\Persisted($this));
    }
1067275
public function authenticateNotification($rawPayload, $provided_signature = null)
    {
        if ($this->getParameter('secret')) {// validate
            $calculated_signature = hash_hmac('sha256', $rawPayload, $this->getParameter('secret'));
            if ($provided_signature != $calculated_signature) {
                return false;
            }
        }

        return true;
    }
80102
public function call_hook($sWhich = '')
    {
        if (!isset($this->aCustomHooks[$sWhich])) {
            return parent::call_hook($sWhich);
        }

        if (isset($this->aCustomHooks[$sWhich][0]) && is_array($this->aCustomHooks[$sWhich][0])) {
            foreach ($this->aCustomHooks[$sWhich] as $aCustomHook) {
                $this->runCustomHook($aCustomHook);
            }
            return true;
        } else {
            $this->runCustomHook($this->aCustomHooks[$sWhich]);
            return true;
        }

        return parent::call_hook($sWhich);
    }
373785
public function usePersistentConnection()
    {
        if (isset($this->outgoing_headers['Accept-Encoding'])) {
            return false;
        }
        $this->protocol_version = '1.1';
        $this->persistentConnection = true;
        $this->setHeader('Connection', 'Keep-Alive');
        return true;
    }
1293270
public function persist()
    {

        $this->ensureRootDirectory();

        $someoneSaved = false;
        foreach ($this->storages as $url=>$storage) {
            $this->ensureStorageDirectory($url);
            if ($storage->persist()) {
                $someoneSaved = true;
            }
        }

        foreach ($this->purgeQueue as $url) {
            $storage = $this->getOrCreateStorage($url);
            if ($storage->purge()) {
                $someoneSaved = true;
            }
            $this->removeStorageIfLoaded($url);
        }

        $this->purgeQueue = [];

        return $someoneSaved;
    }
286786
public function rememberCheckoutUuids(PersistEvent $event)
    {
        if (!$this->support($event->getDocument())) {
            return;
        }

        $this->checkoutUuids[] = $event->getNode()->getIdentifier();
    }
514966
public function deleteResource(PersistentResource $resource)
    {
        try {
            $this->getCurrentBucket()->object($this->keyPrefix . $resource->getSha1())->delete();
        } catch (NotFoundException $e) {
            return true;
        }

        return true;
    }
207170
private function gcPersistent()
    {
        return (bool) $this->app['database']->getDefault()
            ->delete('PersistentSessions')
            ->where('created_at', U::unixToDb(time() - PersistentSession::$sessionLength), '<')
            ->execute();
    }
1145783
public function is_private( $repo ) {
		if ( ! isset( $repo->remote_version ) && ! self::is_doing_ajax() ) {
			return true;
		}
		if ( isset( $repo->remote_version ) && ! self::is_doing_ajax() ) {
			return ( '0.0.0' === $repo->remote_version ) || ! empty( self::$options[ $repo->slug ] );
		}

		return false;
	}
1087405
public function persist()
    {
        if (!$this->wasModified()) {
            return false;
        }

        foreach ($this->getModifiedData() as $id=>$data) {
            $this->writeToDB($id, $data);
        }

        if ($unsettedKeys = $this->getUnsettedKeys()) {
            $this->deleteFromDB($unsettedKeys);
        }

        $this->_originalAttributes = $this->_attributes;

        return true;
    }
763304
public function verifyHash() {
		$this->ensureInput();
		if(empty($this->input['hash']))
			throw new WebHookHandlerException('No hash provided in input payload', WebHookHandlerException::NO_INPUT_HASH);
		
		if($this->input['payloadEncrypted']) {
			if(!$this->payloadJSONString && !$this->getPayload()) return false;
		} else {
			if(!$this->payloadJSONString) $this->payloadJSONString = json_encode($this->input['payload']);
		}
		
		$webHookSalt = substr($this->input['hash'], 0, self::SALT_LENGTH);
		return $this->input['hash'] === $webHookSalt.hash(self::HASH_METHOD, $webHookSalt.$this->secret.$this->payloadJSONString);
	}
213305
public static function addPersistence($persistenceId, array $persistenceConf)
    {
        $manager = self::getDefaultManager();
        $configs = $manager->getOption(self::OPTION_PERSISTENCES);
        $configs[$persistenceId] = $persistenceConf;
        $manager->setOption(self::OPTION_PERSISTENCES, $configs);
        
        $manager->getServiceManager()->register(self::SERVICE_ID, $manager);
    }
38717
public function setNodeOnPersist(PersistEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticlePageDocument || $event->hasNode()) {
            return;
        }

        $pageTitle = $this->getPageTitle($document);

        // if no page-title exists use a unique-id
        $nodeName = $this->slugifier->slugify($pageTitle ?: uniqid('page-', true));
        $nodeName = $this->resolver->resolveName($event->getParentNode(), $nodeName);
        $node = $event->getParentNode()->addNode($nodeName);

        $event->setNode($node);
    }
472467
function _cacheIPN($ipnDataRaw)
    {
        $om = $this->objectManager;
        
        // If we don't already have a cache row,
        if (!($cache = $om->getRepository($this->clsIpnLog)
                ->findOneBy(array('listenerName' => 'IPN', 'transactionType' => 'cache')))) {

            $cache = new $this->clsIpnLog; // Create a new one
            $cache->setListenerName('IPN');
            $cache->setTransactionType('cache');
        }

        // Let's log the raw IPN data - either update or insert
        $cache->setDetail(serialize($ipnDataRaw));
        if(!$cache->getCreatedAt())
            $cache->setCreatedAt(new \DateTime());
        $cache->setUpdatedAt(new \DateTime());
        $om->persist($cache);
        $om->flush();
    }
166976
private IPersistenceStore getStore(IScope scope, boolean persistent) {
        IPersistenceStore store;
        if (!persistent) {
            // Use special store for non-persistent shared objects
            if (!scope.hasAttribute(SO_TRANSIENT_STORE)) {
                store = new RamPersistence(scope);
                scope.setAttribute(SO_TRANSIENT_STORE, store);
                return store;
            }
            return (IPersistenceStore) scope.getAttribute(SO_TRANSIENT_STORE);
        }
        // Evaluate configuration for persistent shared objects
        if (!scope.hasAttribute(SO_PERSISTENCE_STORE)) {
            try {
                store = PersistenceUtils.getPersistenceStore(scope, persistenceClassName);
                log.info("Created persistence store {} for shared objects", store);
            } catch (Exception err) {
                log.warn("Could not create persistence store ({}) for shared objects, falling back to Ram persistence", persistenceClassName, err);
                store = new RamPersistence(scope);
            }
            scope.setAttribute(SO_PERSISTENCE_STORE, store);
            return store;
        }
        return (IPersistenceStore) scope.getAttribute(SO_PERSISTENCE_STORE);
    }