concrete/src/File/Image/Thumbnail/AtomicThumbnailStream.php
private function matchingLock($lockID, array $next, Connection $db)
    {
        // Then go back and double check that we successfully locked it
        $qb = $db->createQueryBuilder();

        $select = $qb
            ->select('*')
            ->from($this->table, 't')
            // Match the lock ID we just tried to set
            ->where($qb->expr()->eq($this->lockColumn, $qb->expr()->literal($lockID)));

        // Build additional predicates from already known values
        $predicates = array_map(function ($value, $key) use ($qb) {
            return $qb->expr()->eq($key, $qb->expr()->literal($value));
        }, $next, array_keys($next));

        call_user_func_array([$select, 'andWhere'], $predicates);

        // Get the result and validate it
        if ($result = $select->setMaxResults(1)->execute()->fetch()) {
            return $result;
        }

        return false;
    }
private function matchingLock($lockID, array $next, Connection $db)
    {
        // Then go back and double check that we successfully locked it
        $qb = $db->createQueryBuilder();

        $select = $qb
            ->select('*')
            ->from($this->table, 't')
            // Match the lock ID we just tried to set
            ->where($qb->expr()->eq($this->lockColumn, $qb->expr()->literal($lockID)));

        // Build additional predicates from already known values
        $predicates = array_map(function ($value, $key) use ($qb) {
            return $qb->expr()->eq($key, $qb->expr()->literal($value));
        }, $next, array_keys($next));

        call_user_func_array([$select, 'andWhere'], $predicates);

        // Get the result and validate it
        if ($result = $select->setMaxResults(1)->execute()->fetch()) {
            return $result;
        }

        return false;
    }
private function matchingLock ( $ lockID , array $ next , Connection $ db ) { // Then go back and double check that we successfully locked it $ qb = $ db -> createQueryBuilder ( ) ; $ select = $ qb -> select ( '*' ) -> from ( $ this -> table , 't' ) // Match the lock ID we just tried to set -> where ( $ qb -> expr ( ) -> eq ( $ this -> lockColumn , $ qb -> expr ( ) -> literal ( $ lockID ) ) ) ; // Build additional predicates from already known values $ predicates = array_map ( function ( $ value , $ key ) use ( $ qb ) { return $ qb -> expr ( ) -> eq ( $ key , $ qb -> expr ( ) -> literal ( $ value ) ) ; } , $ next , array_keys ( $ next ) ) ; call_user_func_array ( [ $ select , 'andWhere' ] , $ predicates ) ; // Get the result and validate it if ( $ result = $ select -> setMaxResults ( 1 ) -> execute ( ) -> fetch ( ) ) { return $ result ; } return false ; }
Find the row matching the passed criteria
This is used to verify that we've successfully locked a row in the database.
@param $lockID
@param array $next
@param \Concrete\Core\Database\Connection\Connection $db
@return bool|mixed
Find the row matching the passed criteria This is used to verify that we ve successfully locked a row in the database .